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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install parcel@next without internet access #26

Closed
boyeborg opened this issue Jan 29, 2020 · 5 comments 路 Fixed by #34
Closed

Unable to install parcel@next without internet access #26

boyeborg opened this issue Jan 29, 2020 · 5 comments 路 Fixed by #34

Comments

@boyeborg
Copy link

馃悰 bug report

I'm unable to install parcel@next on a computer without internet access.
At work, I do most of my work in an air gapped network (i.e. no internet connection). I usually install NPM packages by copying them over to a local NPM registry within our air gapped network, and then installing them as normal (npm/yarn install whatever). This worked for parcel v1, but does no longer work for parcel v2.

馃帥 Configuration (.babelrc, package.json, cli command)

npm i -g parcel@next

馃 Expected Behavior

Parcel gets installed on the computer.

馃槸 Current Behavior

It stops at the @parcel/watcher trying to run prebuild-install -r napi || node-gyp rebuild. Since the computer doesn't have internet access, prebuild-install fails with an error, and the installation gets cancelled.

@mischnic
Copy link
Member

prebuild-install fails with an error, and the installation gets cancelled.

That's why node-gyp rebuild should run as a fallback. Is there an error from that as well?

Which OS are you running?

@boyeborg
Copy link
Author

@mischnic I'm running windows 10, and get the same error with both CMD and PowerShell. I first got an error from node-gyp because it requires python 2.7 (which I dit not have installed). But after installing python 2.7, I get this error:

npm i -g parcel
C:\Users\boyeborg\AppData\Roaming\npm\parcel -> C:\Users\boyeborg\AppData\Roaming\npm\node_modules\parcel\lib\bin.js

> @parcel/watcher@2.0.0-alpha.4 install C:\Users\boyeborg\AppData\Roaming\npm\node_modules\parcel\node_modules\@parcel\watcher
> prebuild-install -r napi || node-gyp rebuild

prebuild-install WARN install getaddrinfo EAI_AGAIN github.com github.com:443

C:\Users\boyeborg\AppData\Roaming\npm\node_modules\parcel\node_modules\@parcel\watcher>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: This is most likely not a problem with node-gyp or the package itself and
gyp ERR! stack is related to network connectivity. In most cases you are behind a proxy or have bad
gyp ERR! stack network settings.
gyp ERR! stack     at Request.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\install.js:197:21)
gyp ERR! stack     at Request.emit (events.js:198:13)
gyp ERR! stack     at Request.onRequestError (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:881:8)
gyp ERR! stack     at ClientRequest.emit (events.js:198:13)
gyp ERR! stack     at TLSSocket.socketErrorListener (_http_client.js:392:9)
gyp ERR! stack     at TLSSocket.emit (events.js:198:13)
gyp ERR! stack     at emitErrorNT (internal/streams/destroy.js:91:8)
gyp ERR! stack     at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
gyp ERR! stack     at process._tickCallback (internal/process/next_tick.js:63:19)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\boyeborg\AppData\Roaming\npm\node_modules\parcel\node_modules\@parcel\watcher
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @parcel/watcher@2.0.0-alpha.4 install: `prebuild-install -r napi || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @parcel/watcher@2.0.0-alpha.4 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\boyeborg\AppData\Roaming\npm-cache\_logs\2020-01-30T07_56_03_166Z-debug.log

@mischnic
Copy link
Member

The node-gyp error message isn't very detailed.
What I do know is that node-gyp downloads a zip containing header files for the Node version you're running (and caches them somewhere in the home directory). Maybe that's why it reports a network error as well.

@boyeborg
Copy link
Author

I dug a little deeper, and was able to get node-gyp not to download anything, however, I'm still stuck with an error.

What I did:

  1. Download the node header for my node version (12.14.1): https://nodejs.org/download/release/12.14.1/node-12.14.1-headers.tar.gz
  2. Add it to npm config: npm config set tarball "/path/to/headers.tar.gz"
  3. Download a zipped version of the node source from https://github.com/nodejs/node
  4. Unzip it and add it to npm config: npm config set nodedir "/path/to/node"

This seems to work, but I get this error from node-gyp:

C:\Users\boyeborg\AppData\Roaming\npm\node_modules\parcel\node_modules\@parcel\watcher>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp: name 'v8_enable_pointer_compression' is not defined while evaluating condition 'v8_enable_pointer_compression == 1' in binding.gyp while trying to load binding.gyp
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:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:223:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\boyeborg\AppData\Roaming\npm\node_modules\parcel\node_modules\@parcel\watcher
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @parcel/watcher@2.0.0-alpha.4 install: `prebuild-install -r napi || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @parcel/watcher@2.0.0-alpha.4 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\boyeborg\AppData\Roaming\npm-cache\_logs\2020-01-30T09_11_13_581Z-debug.log

I'm not going to investigate any further, since all my co-workers would have to do this in order build the app I'm currently working on if I was to use parcel v2. However, I really hope this will work before parcel v2 is released, otherwise I think we would need to move to another build/bundler tool.

@mischnic mischnic transferred this issue from parcel-bundler/parcel Jan 30, 2020
@mischnic
Copy link
Member

We should investigate just including the binaries in the npm tarball (regarding file size).

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

Successfully merging a pull request may close this issue.

2 participants