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

[BUG] npm cannot handle directories with '/' #1242

Closed
JayMellor opened this issue May 4, 2020 · 1 comment
Closed

[BUG] npm cannot handle directories with '/' #1242

JayMellor opened this issue May 4, 2020 · 1 comment
Labels
Bug thing that needs fixing

Comments

@JayMellor
Copy link

JayMellor commented May 4, 2020

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

(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.

@darcyclarke darcyclarke added the Bug thing that needs fixing label Oct 30, 2020
@darcyclarke
Copy link
Contributor

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

Closing: This is an automated message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing
Projects
None yet
Development

No branches or pull requests

2 participants