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

npm install error/python, firebase #1476

Closed
doptster opened this issue Jun 20, 2018 · 13 comments
Closed

npm install error/python, firebase #1476

doptster opened this issue Jun 20, 2018 · 13 comments

Comments

@doptster
Copy link

doptster commented Jun 20, 2018

I tried running the code in a project that I clone from git.
npm install
At the first installation, it says 'Can't find Python executable', but I resolved it by installing a python. and executed
npm --add-python-to-path='true' --debug install --global windows-build-tools
But after that when I tried running again, I got another error:

Traceback (most recent call last): File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 16, in <module> sys.exit(gyp.script_main()) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 545, in script_main return main(sys.argv[1:]) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 538, in main return gyp_main(args) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 523, in gyp_main generator.GenerateOutput(flat_list, targets, data, params) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 2025, in GenerateOutput version=msvs_version) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSNew.py", line 213, in __init__ self.Write() File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSNew.py", line 340, in Write f.close() File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\common.py", line 393, in close os.rename(self.tmp_path, filename) WindowsError: **[Error 183] Cannot create a file when that file already exists**

Anyone has a clue to resolve this?

@doptster doptster changed the title npm installation problem/python (firebase) npm install error/python, firebase Jun 20, 2018
@bnoordhuis
Copy link
Member

Can you post the complete output of npm install?

@doptster
Copy link
Author

doptster commented Jun 21, 2018

`PS C:\Users\USER\Documents\GitHub\hackernews-react-graphql> npm install firebase -D

grpc@1.10.1 install C:\Users\USER\Documents\GitHub\hackernews-react-graphql\node_modules\grpc
node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v64-win32-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.10.1 and node@10.3.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Pre-built binaries not installable for grpc@1.10.1 and node@10.3.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Hit error Connection closed while downloading tarball file
Traceback (most recent call last):
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 16, in
sys.exit(gyp.script_main())
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp_init_.py", line 545, in script_main
return main(sys.argv[1:])
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp_init_.py", line 538, in main
return gyp_main(args)
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp_init_.py", line 523, in gyp_main
generator.GenerateOutput(flat_list, targets, data, params)
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 2025, in GenerateOutput
version=msvs_version)
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSNew.py", line 213, in init
self.Write()
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSNew.py", line 340, in Write
f.close()
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\common.py", line 393, in close
os.rename(self.tmp_path, filename)
WindowsError: [Error 183] Cannot create a file when that file already exists
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=C:\Users\USER\Documents\GitHub\hackernews-react-graphql\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node" "--module_name=grpc_node" "--module_path=C:\Users\USER\Documents\GitHub\hackernews-react-graphql\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown" "--python=C:\Users\USER\AppData\Local\Programs\Python\Python36\python.exe" "--msvs_version=2015"
gyp ERR! cwd C:\Users\USER\Documents\GitHub\hackernews-react-graphql\node_modules\grpc
gyp ERR! node -v v10.3.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\Users\USER\Documents\GitHub\hackernews-react-graphql\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Users\USER\Documents\GitHub\hackernews-react-graphql\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown --python=C:\Users\USER\AppData\Local\Programs\Python\Python36\python.exe --msvs_version=2015' (1)
node-pre-gyp ERR! stack at ChildProcess. (C:\Users\USER\Documents\GitHub\hackernews-react-graphql\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:961:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
node-pre-gyp ERR! System Windows_NT 10.0.16299
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\USER\Documents\GitHub\hackernews-react-graphql\node_modules\grpc\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd C:\Users\USER\Documents\GitHub\hackernews-react-graphql\node_modules\grpc
node-pre-gyp ERR! node -v v10.3.0
node-pre-gyp ERR! node-pre-gyp -v v0.7.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\Users\USER\Documents\GitHub\hackernews-react-graphql\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Users\USER\Documents\GitHub\hackernews-react-graphql\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown --python=C:\Users\USER\AppData\Local\Programs\Python\Python36\python.exe --msvs_version=2015' (1)
npm WARN enzyme-adapter-react-13@1.0.3 requires a peer of react@^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN enzyme-adapter-react-14@1.0.5 requires a peer of react@^0.14.0 but none is installed. You must install peer dependencies yourself.
npm WARN enzyme-adapter-react-14@1.0.5 requires a peer of react-addons-test-utils@^0.14.0 but none is installed. You must install peer dependencies yourself.
npm WARN enzyme-adapter-react-14@1.0.5 requires a peer of react-dom@^0.14.0 but none is installed. You must install peer dependencies yourself.
npm WARN enzyme-adapter-react-15@1.0.5 requires a peer of react@^15.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN enzyme-adapter-react-15@1.0.5 requires a peer of react-dom@^15.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN enzyme-adapter-react-15@1.0.5 requires a peer of react-test-renderer@^15.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN enzyme-adapter-react-15.4@1.0.5 requires a peer of react@15.0.0-0 - 15.4.x but none is installed. You must install peer dependencies yourself.
npm WARN enzyme-adapter-react-15.4@1.0.5 requires a peer of react-dom@15.0.0-0 - 15.4.x but none is installed. You must install peer dependencies yourself.
npm WARN enzyme-adapter-react-15.4@1.0.5 requires a peer of react-addons-test-utils@15.0.0-0 - 15.4.x but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb@15.1.0 requires a peer of eslint-plugin-jsx-a11y@^5.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN hackernews@0.5.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.10.1 install: node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc@1.10.1 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! C:\Users\USER\AppData\Roaming\npm-cache_logs\2018-06-20T04_53_23_183Z-debug.log
2018-06-20T04_53_23_183Z-debug.log
`

@doptster
Copy link
Author

I got the same error when executing npm install and npm install firebase

@richardlau
Copy link
Member

Some observations:

@doptster
Copy link
Author

doptster commented Jun 21, 2018

--python=C:\Users\USER\AppData\Local\Programs\Python\Python36\python.exe"
gyp is not compatible with Python 3 and requires Python 2.

Solved by npm config set python "c:\Python\27\python.exe", thanks for that.

grpc@1.10.1

I am not entirely sure what to do here.. is it by installing later version of firebase? in the package.json is "firebase": "^4.3.1",

UPDATED:
I installed the latest firebase to solve the problem, it's working now! Thanks for the references.
npm install firebase@latest

@LiteSoul
Copy link

Newer firebase versions also have this problem...(currently 5.5.9). What version worked for you?

@SeanSassenrath
Copy link

Newer firebase versions also have this problem...(currently 5.5.9). What version worked for you?

Having the same issue.

@Bastardly
Copy link

Having same issue with firebase. npm i firebase@latest didn't work for me
(And ofc. yarn didn't work either)

Got a 404 on:

Tried to download(404): https://node-precompiled-binaries.grpc.io/grpc/v1.16.0/node-v67-linux-x64-glibc.tar.gz

Node 11.1.0
Node-gyp 3.8.0

@richardlau
Copy link
Member

@Bastardly That is a firebase/grpc issue, not a node-gyp issue. Firebase need to update their dependencies to be compatible with Node.js 11: firebase/firebase-js-sdk#1394

@tamitutor
Copy link

What @richardlau says is correct. I used NVM to downgrade my node version to 10.13.0 and now everything works with installing the firebase@latest package.

@Bastardly
Copy link

@richardlau You are right ofc. :)

@vishalchavanvicky
Copy link

I was gone through same problem solved after lot efforts. It is because of npm version is not compatible with gprc version.
So we need to update the npm.

1 - npm update
2 - npm install

this solve my issue.
Thank you

@kantmichel
Copy link

All needed was an update of NPM. I was horribly behind. For windows people save yourself some additional headache & searching: https://github.com/felixrieseberg/npm-windows-upgrade

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

9 participants