Skip to content

Add tests for spaces in folder names

Rodrigo Muino Tomonari requested to merge github/fork/PaulBags/patch-1 into master

This file of npx uses __dirname. On windows paths are being split on spaces (as of current node.js LTS release), leading to issues like this (which still isn't resolved, despite dev protest).

See below for a log of this issue while attempting to run the react.js tutorial command npx create-react-app my-app (this error occurs both inside and outside the provided node.js cmd environment, with or without adminministrative permissions).

I therefore propose adding a test for spaces in directory names.

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'create-react-app@latest',
1 verbose cli   '--global',
1 verbose cli   '--prefix',
1 verbose cli   'C:\\Users\\User',
1 verbose cli   'Name\\AppData\\Roaming\\npm-cache\\_npx\\3672',
1 verbose cli   '--loglevel',
1 verbose cli   'error',
1 verbose cli   '--json' ]
2 info using npm@6.4.1
3 info using node@v10.15.3
4 verbose npm-session dfbc7ea6f6a9f350
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for file:Name\AppData\Roaming\npm-cache\_npx\3672 Could not install from "Name\AppData\Roaming\npm-cache\_npx\3672" as it does not contain a package.json file.
8 http fetch GET 304 https://registry.npmjs.org/create-react-app 391ms (from cache)
9 silly pacote tag manifest for create-react-app@latest fetched in 403ms
10 timing stage:rollbackFailedOptional Completed in 1ms
11 timing stage:runTopLevelLifecycles Completed in 529ms
12 verbose stack Error: ENOENT: no such file or directory, open 'c:\react_test\Name\AppData\Roaming\npm-cache\_npx\3672\package.json'
13 verbose cwd c:\react_test
14 verbose Windows_NT 10.0.15063
15 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "create-react-app@latest" "--global" "--prefix" "C:\\Users\\User" "Name\\AppData\\Roaming\\npm-cache\\_npx\\3672" "--loglevel" "error" "--json"
16 verbose node v10.15.3
17 verbose npm  v6.4.1
18 error code ENOLOCAL
19 error Could not install from "Name\AppData\Roaming\npm-cache\_npx\3672" as it does not contain a package.json file.
20 verbose exit [ 1, true ]
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading