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

Failed at the electron-mksnapshot@1.6.0 install script #30775

Closed
arunattupurath opened this issue Jul 15, 2017 · 28 comments
Closed

Failed at the electron-mksnapshot@1.6.0 install script #30775

arunattupurath opened this issue Jul 15, 2017 · 28 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@arunattupurath
Copy link

Downloaded vscode source . Following their instructions to build , when I ran

scripts\npm.bat install

Failed at the electron-mksnapshot@1.6.0 install script.

the console also shows the below:

 D:\vscode-master\node_modules\extract-zip\index.js:35
  zipfile.readEntry()
          ^

TypeError: zipfile.readEntry is not a function
at D:\vscode-master\node_modules\extract-zip\index.js:35:15
at D:\vscode-master\node_modules\yauzl\index.js:31:7
at D:\vscode-master\node_modules\yauzl\index.js:96:14
at D:\vscode-master\node_modules\yauzl\index.js:342:5
at D:\vscode-master\node_modules\fd-slicer\index.js:32:7
at FSReqWrap.wrapper [as oncomplete] (fs.js:629:17)

I have installed extract-zip v 1.6.5 , this is mentioned in dependency. No Idea what is going wrong here. I deleted the node_modules and build file and checked again. Does not seem to work. I have asked a question at stackoverflow too.

@arunattupurath
Copy link
Author

here is my debug file. The error is at the bottom of the file.

debug_log.txt

Regards,
Arun A

@arunattupurath
Copy link
Author

Just as an afterthought , I thought I might just add , I tried install this in another fresh sample project of mine and it got installed without any problem. The latest version of electron-mksnapshot is 1.7.1 . Hence I tried changing dependency version in package.json of vscode . Same Error persists.

@chrmarti
Copy link
Contributor

Is this with npm 5.x? Could you try with 4.x? This might be addressed by #30759.

@chrmarti chrmarti self-assigned this Jul 16, 2017
@chrmarti chrmarti added the info-needed Issue requires more information from poster label Jul 16, 2017
@firelizzard18
Copy link

I'm running into this issue. I ran npm install npm@4.6.1 and then modified script/npm.sh to use the project-local version. It did not fix the issue.

npm 5.3.0

> code-oss-dev@1.15.0 preinstall /Users/firelizzard/Source/vscode
> node build/npm/preinstall.js

npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated to-iso-string@0.0.2: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated minimatch@0.2.12: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.

> electron-mksnapshot@1.6.0 install /Users/firelizzard/Source/vscode/node_modules/electron-mksnapshot
> node ./download-mksnapshot.js

undefined
/Users/firelizzard/Source/vscode/node_modules/extract-zip/index.js:36
      zipfile.readEntry()
              ^

TypeError: zipfile.readEntry is not a function
    at /Users/firelizzard/Source/vscode/node_modules/extract-zip/index.js:36:15
    at /Users/firelizzard/Source/vscode/node_modules/yauzl/index.js:31:7
    at /Users/firelizzard/Source/vscode/node_modules/yauzl/index.js:96:14
    at /Users/firelizzard/Source/vscode/node_modules/yauzl/index.js:342:5
    at /Users/firelizzard/Source/vscode/node_modules/fd-slicer/index.js:32:7
    at FSReqWrap.wrapper [as oncomplete] (fs.js:663:17)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: windows-mutex@0.2.0 (node_modules/windows-mutex):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for windows-mutex@0.2.0: wanted {"os":"win32","arch":"any"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: windows-foreground-love@0.1.0 (node_modules/windows-foreground-love):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for windows-foreground-love@0.1.0: wanted {"os":"win32","arch":"any"} (current: {"os":"darwin","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron-mksnapshot@1.6.0 install: `node ./download-mksnapshot.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the electron-mksnapshot@1.6.0 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/firelizzard/.electron-gyp/.npm/_logs/2017-07-16T01_44_37_597Z-debug.log

npm 4.6.1

> code-oss-dev-build@1.0.0 postinstall /Users/firelizzard/Source/vscode/build
> npm run compile


> code-oss-dev-build@1.0.0 compile /Users/firelizzard/Source/vscode/build
> tsc

lib/extensions.ts(19,23): error TS2307: Cannot find module 'vsce'.
lib/i18n.ts(14,23): error TS2307: Cannot find module 'glob'.
lib/optimize.ts(13,25): error TS2307: Cannot find module 'gulp-uglify'.
lib/optimize.ts(14,27): error TS2307: Cannot find module 'gulp-uglify/composer'.
lib/optimize.ts(15,27): error TS2307: Cannot find module 'uglify-es'.
lib/test/i18n.test.ts(9,1): error TS2304: Cannot find name 'suite'.
lib/test/i18n.test.ts(17,2): error TS2304: Cannot find name 'test'.
lib/test/i18n.test.ts(25,2): error TS2304: Cannot find name 'test'.
lib/test/i18n.test.ts(32,2): error TS2304: Cannot find name 'test'.
lib/tslint/allowAsyncRule.ts(7,23): error TS2307: Cannot find module 'tslint'.
lib/tslint/allowAsyncRule.ts(11,24): error TS2339: Property 'getOptions' does not exist on type 'Rule'.
lib/tslint/allowAsyncRule.ts(12,15): error TS2339: Property 'applyWithWalker' does not exist on type 'Rule'.
lib/tslint/allowAsyncRule.ts(12,68): error TS2339: Property 'getOptions' does not exist on type 'Rule'.
lib/tslint/allowAsyncRule.ts(45,8): error TS2339: Property 'addFailureAtNode' does not exist on type 'AsyncRuleWalker'.
lib/tslint/duplicateImportsRule.ts(8,23): error TS2307: Cannot find module 'tslint'.
lib/tslint/duplicateImportsRule.ts(12,15): error TS2339: Property 'applyWithWalker' does not exist on type 'Rule'.
lib/tslint/duplicateImportsRule.ts(12,67): error TS2339: Property 'getOptions' does not exist on type 'Rule'.
lib/tslint/duplicateImportsRule.ts(35,9): error TS2339: Property 'addFailure' does not exist on type 'ImportPatterns'.
lib/tslint/duplicateImportsRule.ts(35,25): error TS2339: Property 'createFailure' does not exist on type 'ImportPatterns'.
lib/tslint/importPatternsRule.ts(7,23): error TS2307: Cannot find module 'tslint'.
lib/tslint/importPatternsRule.ts(19,48): error TS2339: Property 'getOptions' does not exist on type 'Rule'.
lib/tslint/importPatternsRule.ts(24,17): error TS2339: Property 'applyWithWalker' does not exist on type 'Rule'.
lib/tslint/importPatternsRule.ts(24,69): error TS2339: Property 'getOptions' does not exist on type 'Rule'.
lib/tslint/importPatternsRule.ts(64,21): error TS2339: Property 'getSourceFile' does not exist on type 'ImportPatterns'.
lib/tslint/importPatternsRule.ts(84,9): error TS2339: Property 'addFailure' does not exist on type 'ImportPatterns'.
lib/tslint/importPatternsRule.ts(84,25): error TS2339: Property 'createFailure' does not exist on type 'ImportPatterns'.
lib/tslint/layeringRule.ts(7,23): error TS2307: Cannot find module 'tslint'.
lib/tslint/layeringRule.ts(19,23): error TS2339: Property 'getOptions' does not exist on type 'Rule'.
lib/tslint/layeringRule.ts(41,15): error TS2339: Property 'applyWithWalker' does not exist on type 'Rule'.
lib/tslint/layeringRule.ts(41,73): error TS2339: Property 'getOptions' does not exist on type 'Rule'.
lib/tslint/layeringRule.ts(94,10): error TS2339: Property 'addFailure' does not exist on type 'LayeringRule'.
lib/tslint/layeringRule.ts(94,26): error TS2339: Property 'createFailure' does not exist on type 'LayeringRule'.
lib/tslint/noUnexternalizedStringsRule.ts(7,23): error TS2307: Cannot find module 'tslint'.
lib/tslint/noUnexternalizedStringsRule.ts(14,15): error TS2339: Property 'applyWithWalker' does not exist on type 'Rule'.
lib/tslint/noUnexternalizedStringsRule.ts(14,86): error TS2339: Property 'getOptions' does not exist on type 'Rule'.
lib/tslint/noUnexternalizedStringsRule.ts(64,29): error TS2339: Property 'getOptions' does not exist on type 'NoUnexternalizedStringsRuleWalker'.
lib/tslint/noUnexternalizedStringsRule.ts(88,11): error TS2339: Property 'addFailure' does not exist on type 'NoUnexternalizedStringsRuleWalker'.
lib/tslint/noUnexternalizedStringsRule.ts(88,28): error TS2339: Property 'createFailure' does not exist on type 'NoUnexternalizedStringsRuleWalker'.
lib/tslint/noUnexternalizedStringsRule.ts(117,9): error TS2339: Property 'addFailure' does not exist on type 'NoUnexternalizedStringsRuleWalker'.
lib/tslint/noUnexternalizedStringsRule.ts(117,25): error TS2339: Property 'createFailure' does not exist on type 'NoUnexternalizedStringsRuleWalker'.
lib/tslint/noUnexternalizedStringsRule.ts(151,9): error TS2339: Property 'addFailure' does not exist on type 'NoUnexternalizedStringsRuleWalker'.
lib/tslint/noUnexternalizedStringsRule.ts(151,25): error TS2339: Property 'createFailure' does not exist on type 'NoUnexternalizedStringsRuleWalker'.
lib/tslint/translationRemindRule.ts(7,23): error TS2307: Cannot find module 'tslint'.
lib/tslint/translationRemindRule.ts(12,15): error TS2339: Property 'applyWithWalker' does not exist on type 'Rule'.
lib/tslint/translationRemindRule.ts(12,80): error TS2339: Property 'getOptions' does not exist on type 'Rule'.
lib/tslint/translationRemindRule.ts(70,9): error TS2339: Property 'addFailureAtNode' does not exist on type 'TranslationRemindRuleWalker'.
lib/typings/event-stream.d.ts(4,28): error TS2307: Cannot find module 'map-stream'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! code-oss-dev-build@1.0.0 compile: `tsc`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the code-oss-dev-build@1.0.0 compile 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/firelizzard/.electron-gyp/.npm/_logs/2017-07-16T01_52_03_580Z-debug.log
npm WARN code-oss-dev-build@1.0.0 No description
npm WARN code-oss-dev-build@1.0.0 No repository field.
npm WARN code-oss-dev-build@1.0.0 No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! code-oss-dev-build@1.0.0 postinstall: `npm run compile`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the code-oss-dev-build@1.0.0 postinstall 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/firelizzard/.electron-gyp/.npm/_logs/2017-07-16T01_52_03_633Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! code-oss-dev@1.15.0 postinstall: `node build/npm/postinstall.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the code-oss-dev@1.15.0 postinstall 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/firelizzard/.electron-gyp/.npm/_logs/2017-07-16T01_52_03_687Z-debug.log

@firelizzard18
Copy link

I got npm.sh install to complete by trying to run code.sh, installing the package it complained about, running, etc, for about five packages. I didn't install them all. Then I ran npm.sh install and it worked...

I'm getting a different error from code.sh: no such file or directory, open '/Users/firelizzard/Source/vscode/out/vs/code/electron-main/app.js'. But that may be a different issue.

@loatheb
Copy link

loatheb commented Jul 16, 2017

@firelizzard18 I met the same error with the npm@5.3.0. After checking some dependencies, I removed the npm-shrinkwrap.json, it could solve this problem.

@arunattupurath
Copy link
Author

Installed 4.6.1 . Didn't work initially. Took a fresh vscode source and built again and voila ! .. well what do you know !... That worked.
Thanks :-)

@firelizzard18
Copy link

I got it to work, without changing my global NPM version:

  1. Clean everything - git clean -fdx
  2. Try to locally install npm 4.6.1 - failed with lots of messages that I didn't read
  3. Remove npm-shrinkwrap.json
  4. Successfully install npm 4.6.1
  5. Modify ./scripts/npm.sh to execute "$ROOT"/node_modules/.bin/npm instead of npm
  6. Installed things - ./script/npm.sh install
  7. Restore npm-shrinkwrap.json - git checkout -- npm-shrinkwrap.json
  8. npm run watch
  9. Something complained about vs/code/electron-main/main.ts (JS missing from out) so I touched that file and the watch task compiled it
  10. Tried to run ./scripts/code.sh - failed because one of the modules was compiled using the wrong version of NPM
  11. Rebuilt things - ./script/npm.sh rebuild
  12. Successfully ran ./scripts/code.sh

@chrmarti
Copy link
Contributor

Shouldn't take that much back and forth. You could also retry with npm 5.x since #30759 was merged.

@Jeyanthinath
Copy link
Contributor

Jeyanthinath commented Jul 24, 2017

Thanks @firelizzard18 following your procedure I fixed the issue I faced

@chrmarti , I pull latest still with 5.X I have no luck

@chrmarti
Copy link
Contributor

@Jeyanthinath What are the error messages you get? Does it work with npm 4?

@Jeyanthinath
Copy link
Contributor

Jeyanthinath commented Jul 24, 2017

> node ./download-mksnapshot.js

/home/jeyanthinath/Documents/git/vscode/vscode/node_modules/extract-zip/index.js:35
      zipfile.readEntry()
              ^

TypeError: zipfile.readEntry is not a function
    at /home/jeyanthinath/Documents/git/vscode/vscode/node_modules/extract-zip/index.js:35:15
    at /home/jeyanthinath/Documents/git/vscode/vscode/node_modules/yauzl/index.js:31:7
    at /home/jeyanthinath/Documents/git/vscode/vscode/node_modules/yauzl/index.js:96:14
    at /home/jeyanthinath/Documents/git/vscode/vscode/node_modules/yauzl/index.js:342:5
    at /home/jeyanthinath/Documents/git/vscode/vscode/node_modules/fd-slicer/index.js:32:7
    at FSReqWrap.wrapper [as oncomplete] (fs.js:682:17)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@0.3.8 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@0.3.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: windows-foreground-love@0.1.0 (node_modules/windows-foreground-love):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for windows-foreground-love@0.1.0: wanted {"os":"win32","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: windows-mutex@0.2.0 (node_modules/windows-mutex):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for windows-mutex@0.2.0: wanted {"os":"win32","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron-mksnapshot@1.6.0 install: `node ./download-mksnapshot.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron-mksnapshot@1.6.0 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!     /home/jeyanthinath/.electron-gyp/.npm/_logs/2017-07-24T14_10_52_529Z-debug.log


jeyanthinath@jeyanthinath-ThinkPad:~/Documents/git/vscode/vscode$ npm -v
5.3.0

@chrmarti It works with npm at install stage , but while brining up vscode it failed saying it needs to be compiled with wrong version

But when I goes with 5.3 it is not getting installed

@chrmarti
Copy link
Contributor

@Jeyanthinath I'm not sure we have looked into npm 5 support in detail. Could you try with npm 4 and first git clean -xfd to make sure you start from a clean state? Also: It is important to use ./scripts/npm.sh install so native modules are compiled against the right node version.

@joaomoreno
Copy link
Member

We have looked into npm 5 in detail: #29576 It is not ready for us yet, but you can follow #30134 to be notified when we move to it.

Please use npm 4 meanwhile.

@joaomoreno
Copy link
Member

joaomoreno commented Jul 25, 2017

@chrmarti #30759 was merged and reverted the next day, since it broke many other things. That was a full day of work for me to fix.

@Jeyanthinath
Copy link
Contributor

@chrmarti After cleaning with git clean -xfd and downgrading npm to 4.6 from 5.3 it works like a charm :)

@marswong
Copy link

@joaomoreno @chrmarti
hello, on macOS 10.12.6 with node 6.11.1 and npm 4.6.1, still get an error with Failed at the vscode-ripgrep@0.0.12 postinstall script.. I had run git clean -xfd before executing ./scripts/npm.sh install. Please checkout this again :)

@loatheb
Copy link

loatheb commented Jul 31, 2017

@marswong do you have a VPN, I mean the reason maybe the GFW when doing the post install.

@marswong
Copy link

marswong commented Jul 31, 2017

@loatheb
maybe there is nothing to do with the network. I just don't know why vscode-ripgrep@0.0.12 postinstall just execute node ./dist/postinstall.js, for there is no dist directory on workspace.

@firelizzard18
Copy link

firelizzard18 commented Jul 31, 2017 via email

@chrmarti
Copy link
Contributor

@marswong Can you update to the latest in master, git clean -xfd and ./scripts/npm.sh install again to make sure it is not a problem that is already fixed in the latest code? If the problem persists please open a new issue as this is a different problem. Thanks.

@marswong
Copy link

marswong commented Aug 1, 2017

@chrmarti it seems that the latest code works today. thank you :)

@ryder-d
Copy link

ryder-d commented Aug 28, 2017

What are the suggested steps to install using NPM@4.61 after installing locally?

@chrmarti
Copy link
Contributor

@devonryder You can try the commands in my above comment (#30775 (comment)).

@ryder-d
Copy link

ryder-d commented Aug 30, 2017

@chrmarti Same error, my global NPM is 5.3.0.

@chrmarti
Copy link
Contributor

@devonryder You could change the last line in ./scripts/npm.shto point to your local npm install.

@ryder-d
Copy link

ryder-d commented Aug 31, 2017

@chrmarti What should this line look like? I'd be changing the line npm $* to "$ROOT"/node_modules/.bin/npm $*? Note: I am installing via the source from AUR.

@chrmarti
Copy link
Contributor

@devonryder I guess so, does that not work?

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

8 participants