npm install error Call constructor cannot be invoked without 'new'


(Bret Askeland) #1

Node: v10.15.0
NPM: v6.4.1

C:\windows\system32>npm install -g gulp
npm ERR! Windows_NT 10.0.17134
npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “install” “-g” “gulp”
npm ERR! node v10.15.0
npm ERR! npm v6.4.1

npm ERR! Class constructor cannot be invoked without ‘new’
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\BJASKELA\AppData\Roaming\npm-cache_logs\2019-01-14T14_03_25_369Z-debug.log

65 verbose addTmpTarball C:\Users\BJASKELA\AppData\Local\Temp\npm-8336-83f29c3c\registry.npmjs.org\gulp-\gulp-4.0.0.tgz not in flight; adding
66 verbose addTmpTarball already have metadata; skipping unpack for gulp@4.0.0
67 verbose correctMkdir C:\Users\BJASKELA\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
68 silly cache afterAdd gulp@4.0.0
69 verbose afterAdd C:\Users\BJASKELA\AppData\Roaming\npm-cache\gulp\4.0.0\package\package.json not in flight; writing
70 verbose correctMkdir C:\Users\BJASKELA\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
71 verbose afterAdd C:\Users\BJASKELA\AppData\Roaming\npm-cache\gulp\4.0.0\package\package.json written
72 verbose stack TypeError: Class constructor cannot be invoked without ‘new’
72 verbose stack at doUntar (C:\Users\BJASKELA\AppData\Roaming\nvm\v7.10.0\node_modules\npm\lib\fetch-package-metadata.js:323:33)
72 verbose stack at doGunzip (C:\Users\BJASKELA\AppData\Roaming\nvm\v7.10.0\node_modules\npm\lib\fetch-package-metadata.js:319:5)
72 verbose stack at ReadStream.OD (C:\Users\BJASKELA\AppData\Roaming\nvm\v7.10.0\node_modules\npm\lib\fetch-package-metadata.js:295:7)
72 verbose stack at ReadStream.emit (events.js:182:13)
72 verbose stack at addChunk (_stream_readable.js:283:12)
72 verbose stack at readableAddChunk (_stream_readable.js:264:11)
72 verbose stack at ReadStream.Readable.push (_stream_readable.js:219:10)
72 verbose stack at lazyFs.read (internal/fs/streams.js:181:12)
72 verbose stack at callback (C:\Users\BJASKELA\AppData\Roaming\nvm\v7.10.0\node_modules\npm\node_modules\graceful-fs\polyfills.js:128:19)
72 verbose stack at FSReqWrap.wrapper [as oncomplete] (fs.js:463:17)
73 verbose cwd C:\windows\system32


(Bret Askeland) #2

I had node version manager for windows installed NVM and that was causing an issue for some reason. I removed NVM completely and it worked fine afterwards.