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

Cannot install via npm when there is space in system username #595

Closed
cyj5230 opened this issue Jun 2, 2021 · 1 comment
Closed

Cannot install via npm when there is space in system username #595

cyj5230 opened this issue Jun 2, 2021 · 1 comment

Comments

@cyj5230
Copy link

cyj5230 commented Jun 2, 2021

Failed to install via rpm, the error message shows there are spaces in the path, seems it can be solved by adding quotes?

Rename and restart the computer may help, but the username is set by my company, and I don't want my teammates to do so just for installing a package.

Finally I installed opencc-js instead, but I really want to use opencc when it is possible, thank you very much!

Yuki-Chen:nodebb yuki chen$ sudo npm i opencc
npm WARN deprecated node-pre-gyp@0.14.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future

> opencc@1.1.2 install /Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc
> node-pre-gyp install --fallback-to-build || node-pre-gyp rebuild

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://github.com/BYVoid/OpenCC/releases/download/1.1.2/opencc-v1.1.2-node-v83-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for opencc@1.1.2 and node@14.16.1 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) 
Traceback (most recent call last):
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
    sys.exit(gyp.script_main())
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
    return main(sys.argv[1:])
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
    return gyp_main(args)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 532, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2215, in GenerateOutput
    part_of_all=qualified_target in needed_targets)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 794, in Write
    extra_mac_bundle_resources, part_of_all)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 968, in WriteActions
    "Spaces in action input filenames not supported (%s)"  % input)
AssertionError: Spaces in action input filenames not supported (/Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc/data/dictionary/STCharacters.txt)
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc/build/Release/opencc.node" "--module_name=opencc" "--module_path=/Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc/build/Release" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd /Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc
gyp ERR! node -v v14.16.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc/build/Release/opencc.node --module_name=opencc --module_path=/Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc/build/Release --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/yuki chen/Documents/scripts/nodebb/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1048:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Darwin 20.3.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/yuki chen/Documents/scripts/nodebb/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc
node-pre-gyp ERR! node -v v14.16.1
node-pre-gyp ERR! node-pre-gyp -v v0.14.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc/build/Release/opencc.node --module_name=opencc --module_path=/Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc/build/Release --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
Traceback (most recent call last):
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
    sys.exit(gyp.script_main())
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
    return main(sys.argv[1:])
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
    return gyp_main(args)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 532, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2215, in GenerateOutput
    part_of_all=qualified_target in needed_targets)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 794, in Write
    extra_mac_bundle_resources, part_of_all)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 968, in WriteActions
    "Spaces in action input filenames not supported (%s)"  % input)
AssertionError: Spaces in action input filenames not supported (/Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc/data/dictionary/STCharacters.txt)
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--module=/Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc/build/Release/opencc.node" "--module_name=opencc" "--module_path=/Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc/build/Release" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd /Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc
gyp ERR! node -v v14.16.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --module=/Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc/build/Release/opencc.node --module_name=opencc --module_path=/Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc/build/Release --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/yuki chen/Documents/scripts/nodebb/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1048:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Darwin 20.3.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/yuki chen/Documents/scripts/nodebb/node_modules/.bin/node-pre-gyp" "rebuild"
node-pre-gyp ERR! cwd /Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc
node-pre-gyp ERR! node -v v14.16.1
node-pre-gyp ERR! node-pre-gyp -v v0.14.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --module=/Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc/build/Release/opencc.node --module_name=opencc --module_path=/Users/yuki chen/Documents/scripts/nodebb/node_modules/opencc/build/Release --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! opencc@1.1.2 install: `node-pre-gyp install --fallback-to-build || node-pre-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the opencc@1.1.2 install 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/yuki chen/.npm/_logs/2021-06-02T03_36_27_688Z-debug.log
@cyj5230
Copy link
Author

cyj5230 commented Jun 2, 2021

Seems this is not related to opencc, but related to node-gyp.
Then I will close this issue.

P.S. tried this workaround but not working: nodejs/node-gyp#65 (comment)

@cyj5230 cyj5230 closed this as completed Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant