Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cross-env: command not found #493

Closed
krispind opened this issue Jun 7, 2016 · 16 comments
Closed

cross-env: command not found #493

krispind opened this issue Jun 7, 2016 · 16 comments
Labels

Comments

@krispind
Copy link

krispind commented Jun 7, 2016

I'm running node 4.4.5 locally. Cloned the repo, ran setup command without issue. On 'npm run start' I get an error:

[email protected] start /Users/kdolbear/Documents/Jobs/mower/react-boilerplate
npm run start:tunnel

[email protected] start:tunnel /Users/kdolbear/Documents/Jobs/mower/react-boilerplate
cross-env NODE_ENV=development node server

sh: cross-env: command not found

npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start:tunnel"
npm ERR! node v4.4.5
npm ERR! npm v2.15.5
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] start:tunnel: cross-env NODE_ENV=development node server
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] start:tunnel script 'cross-env NODE_ENV=development node server'.
npm ERR! This is most likely a problem with the react-boilerplate package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env NODE_ENV=development node server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs react-boilerplate
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls react-boilerplate
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/kdolbear/Documents/Jobs/mower/react-boilerplate/npm-debug.log

npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v4.4.5
npm ERR! npm v2.15.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: npm run start:tunnel
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'npm run start:tunnel'.
npm ERR! This is most likely a problem with the react-boilerplate package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run start:tunnel
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs react-boilerplate
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls react-boilerplate
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/kdolbear/Documents/Jobs/mower/react-boilerplate/npm-debug.log

And here's the log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart [email protected]
6 info start [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec start script
9 verbose stack Error: [email protected] start: npm run start:tunnel
9 verbose stack Exit status 1
9 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:217:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:827:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid [email protected]
11 verbose cwd /Users/kdolbear/Documents/Jobs/mower/react-boilerplate
12 error Darwin 15.5.0
13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
14 error node v4.4.5
15 error npm v2.15.5
16 error code ELIFECYCLE
17 error [email protected] start: npm run start:tunnel
17 error Exit status 1
18 error Failed at the [email protected] start script 'npm run start:tunnel'.
18 error This is most likely a problem with the react-boilerplate package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error npm run start:tunnel
18 error You can get information on how to open an issue for this project with:
18 error npm bugs react-boilerplate
18 error Or if that isn't available, you can get their info via:
18 error
18 error npm owner ls react-boilerplate
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

@mxstbr
Copy link
Member

mxstbr commented Jun 7, 2016

npm install cross-env will fix your problems! I wonder why that's not installed…

@mxstbr mxstbr changed the title npm run start failing on osx 10.11.5 cross-env: command not found Jun 7, 2016
@mxstbr mxstbr added the bug label Jun 7, 2016
@krispind
Copy link
Author

krispind commented Jun 7, 2016

Thanks for the prompt reply. I installed cross-env, restarted CLI, re-cloned repo just to be sure I had a clean slate and am getting the same error as before.

@krispind
Copy link
Author

krispind commented Jun 7, 2016

I upgraded node to the most recent release - 6.2.1 - and re-ran. This time I got the following:
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "setup"
npm ERR! node v6.2.1
npm ERR! npm v3.9.3
npm ERR! code MODULE_NOT_FOUND

npm ERR! Cannot find module 'github-url-from-git'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /Users/kdolbear/Documents/Jobs/mower/react-boilerplate/npm-debug.log

with this in the log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'setup' ]
2 info using [email protected]
3 info using [email protected]
4 verbose stack Error: Cannot find module 'github-url-from-git'
4 verbose stack at Function.Module._resolveFilename (module.js:440:15)
4 verbose stack at Function.Module._load (module.js:388:25)
4 verbose stack at Module.require (module.js:468:17)
4 verbose stack at require (internal/module.js:20:19)
4 verbose stack at Object. (/usr/local/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js:2:22)
4 verbose stack at Module._compile (module.js:541:32)
4 verbose stack at Object.Module._extensions..js (module.js:550:10)
4 verbose stack at Module.load (module.js:458:32)
4 verbose stack at tryModuleLoad (module.js:417:12)
4 verbose stack at Function.Module._load (module.js:409:3)
5 verbose cwd /Users/kdolbear/Documents/Jobs/mower/react-boilerplate
6 error Darwin 15.5.0
7 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "setup"
8 error node v6.2.1
9 error npm v3.9.3
10 error code MODULE_NOT_FOUND
11 error Cannot find module 'github-url-from-git'
12 error If you need help, you may report this error at:
12 error https://github.com/npm/npm/issues
13 verbose exit [ 1, true ]

@datapimp
Copy link
Collaborator

datapimp commented Jun 8, 2016

I'm also having some weird issues with this lib. I was able to fix them by deleting and reinstalling cross-env and then creating my own symlink manually in $boilerplate-root/node_modules/.bin/

obviously that isn't a solution

@mxstbr
Copy link
Member

mxstbr commented Jun 8, 2016

Hmm, that's really weird, not sure what we can do to fix this though…

@datapimp
Copy link
Collaborator

datapimp commented Jun 8, 2016

I can't reproduce it regularly either. We need to add it as a production dependency anyway so hopefully it just goes away;

@krispind
Copy link
Author

krispind commented Jun 8, 2016

As I mentioned above, in trying to fix the issue I had upgraded Node locally. I did a little searching on NPM issues and found this. I manually removed Node and NPM, then did a clean install of 6.2.1, cloned the boilerplate repo and everything works perfectly.

@mxstbr
Copy link
Member

mxstbr commented Jun 8, 2016

Okay, perfect, this doesn't seem like something we can fix from our side. Glad this is resolved for you @krispind, I'll close this for now!

@mxstbr mxstbr closed this as completed Jun 8, 2016
@Dmitry-N-Medvedev
Copy link

Hm,
I ran across the same exact issue when yarn run start was running in one terminal, and yarn bild in the other.

One of the log messages read as follows:

error An unexpected error occurred: "ETXTBSY: text file is busy, open '/home/dmitry/project/node_modules/ngrok/bin/ngrok'".

Stopping the yarn run start process magically fixed it.

@rikudosama
Copy link

hello after running npm install cross_env it works but i still have some troubles.It said that their and error for compiling the file

@TomSendible
Copy link

This maybe an unnecessary addition but I found using Git Bash to access Npm and setup the boilerplate caused issues. Usually I can use Git Bash for Npm commands but here I had to clone the repo in Git Bash then switch to windows CMD to complete the setup.

@HungrySeason
Copy link

thanks men!

@LisaYF
Copy link

LisaYF commented Dec 8, 2017

sh: 1: cross-env: not found

npm ERR! Linux 3.10.0-514.6.2.el7.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v6.2.2
npm ERR! npm v3.9.5
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] build: cross-env NODE_ENV=production language=en webpack --progress --hide-modules
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] build script 'cross-env NODE_ENV=production language=en webpack --progress --hide-modules'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the disney-game package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env NODE_ENV=production language=en webpack --progress --hide-modules
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs disney-game
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls disney-game
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/jenkins/workspace/Disney_node_demon/DocMcstuffins/Doc.McS.S01F024/act2_cache_the_red_car/src/page/npm-debug.log
Build step 'Execute shell' marked build as failure
Finished: FAILURE

@LisaYF
Copy link

LisaYF commented Dec 8, 2017

Hello men, I still didn't slove this problem. Can anybody puts some specific methods?

@weikee94
Copy link

@LisaYF did u try @krispind suggestion?

@lock
Copy link

lock bot commented May 29, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

9 participants