You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found when creating a React project that I could not run any modules using run-script with reference to package.json, nor using npx (it would always try to install a new copy of the module). I cloned previous git repositories and found the same problem, even though the work on another machine.
I found this was because the directories these codebases were stored in was 'Learning / Testing Apps', which unix translated to 'Learning : Testing Apps'. This caused problems with the PATH argument of npm_config: colons separate paths, so the path was stored in two parts.
Either this is simply a case of 'don't do it', or it is something that can be addressed should anyone else have this trouble (even an error message if possible).
When
(base) <name> test-app % npm run build
> test-app@1.0.0 build /Users/<name>/Documents/Learning : Testing apps/React Apps/test-app
> webpack-dev-server --config webpack.config.js
sh: webpack-dev-server: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! test-app@1.0.0 build: `webpack-dev-server --config webpack.config.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the test-app@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/<name>/.npm/_logs/2020-05-04T13_17_06_820Z-debug.log
Note that a package.json exists in this directory with webpack-dev-server as a dev-dependency; directly calling it from node_modules/.bin can be done without issues.
Where
None known.
How
Get 'command not found' errors. Technically true (path is corrupted), but mentioning the problematic folder name would be ideal.
Steps to Reproduce
create a directory with '/' and add package.json within.
Current Behaviour
npm fails with 'command not found' error when module exists both in package.json and node_modules (and both are set up correctly).
Expected Behaviour
Either can handle '/' in folder or throws a related error message.
The text was updated successfully, but these errors were encountered:
npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.
If your bug is reproducible on v7, please re-file this issue using our new issue template.
If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo
What / Why
I found when creating a React project that I could not run any modules using run-script with reference to package.json, nor using npx (it would always try to install a new copy of the module). I cloned previous git repositories and found the same problem, even though the work on another machine.
I found this was because the directories these codebases were stored in was 'Learning / Testing Apps', which unix translated to 'Learning : Testing Apps'. This caused problems with the PATH argument of npm_config: colons separate paths, so the path was stored in two parts.
Either this is simply a case of 'don't do it', or it is something that can be addressed should anyone else have this trouble (even an error message if possible).
When
Note that a package.json exists in this directory with webpack-dev-server as a dev-dependency; directly calling it from node_modules/.bin can be done without issues.
Where
None known.
How
Get 'command not found' errors. Technically true (path is corrupted), but mentioning the problematic folder name would be ideal.
Steps to Reproduce
create a directory with '/' and add package.json within.
Current Behaviour
npm fails with 'command not found' error when module exists both in package.json and node_modules (and both are set up correctly).
Expected Behaviour
Either can handle '/' in folder or throws a related error message.
The text was updated successfully, but these errors were encountered: