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
If spaces are in the path to npm-cache you always get the following error when executing npx:
C:\dev\adapter>npx @iobroker/create-adapter
npm ERR! code ENOLOCAL
npm ERR! Could not install from "Files\iobroker\SmartHome17\env\npm-cache\_npx\2772" as it does not contain a package.json file.
In this case the path to npm-cache was 'C:\Program Files\iobroker\SmartHome17\env\npm-cache'.
More logging:
1 verbose cli [ 'C:\\Program Files\\iobroker\\SmartHome17\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\iobroker\\SmartHome17\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '@iobroker/create-adapter@latest',
1 verbose cli '--global',
1 verbose cli '--prefix',
1 verbose cli 'C:\\Program',
1 verbose cli 'Files\\iobroker\\SmartHome17\\env\\npm-cache\\_npx\\8336',
2 info using [email protected]
3 info using [email protected]
7 silly fetchPackageMetaData error for file:Files\iobroker\SmartHome17\env\npm-cache\_npx\8336 Could not install from "Files\iobroker\SmartHome17\env\npm-cache\_npx\8336" as it does not contain a package.json file.
12 verbose stack Error: ENOENT: no such file or directory, open 'C:\dev\adapter\Files\iobroker\SmartHome17\env\npm-cache\_npx\8336\package.json'
14 verbose Windows_NT 10.0.17134
15 verbose argv "C:\\Program Files\\iobroker\\SmartHome17\\nodejs\\node.exe" "C:\\Program Files\\iobroker\\SmartHome17\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "@iobroker/create-adapter@latest" "--global" "--prefix" "C:\\Program" "Files\\iobroker\\SmartHome17\\env\\npm-cache\\_npx\\8336" "--loglevel" "error" "--json"
NOTE: Why the weird escape condition? Because the child.spawn npm always runs in shell mode when on Windows (it's the default, to prevent weird behavior). That means that arguments to npm need to be escaped (but as strings, not as paths).
The regular unix invocation doesn't need escaping, because it doesn't run in shell mode.
The text was updated successfully, but these errors were encountered:
Stabilostick
changed the title
npx doesn't work at all if spaces are in the path to npm-cache
npx doesn't work at all on Windows if spaces are in the path to npm-cache
Sep 5, 2019
If spaces are in the path to npm-cache you always get the following error when executing npx:
In this case the path to npm-cache was 'C:\Program Files\iobroker\SmartHome17\env\npm-cache'.
More logging:
NOTE: Why the weird escape condition? Because the child.spawn npm always runs in shell mode when on Windows (it's the default, to prevent weird behavior). That means that arguments to npm need to be escaped (but as strings, not as paths).
The regular unix invocation doesn't need escaping, because it doesn't run in shell mode.
npx GitHub issues:
zkat/npx#146 - workaround, not solved, closed
zkat/npx#100 - open, since July 2017
zkat/npx#223 - open, is npx project dead?
npm/npx#6
Solution:
zkat/npx#181 - open since May 2018
The text was updated successfully, but these errors were encountered: