npm ERR spawn ENOENT - javascript

I am new to Node and I have this double error which is confusing for noobs like me...
Here is exactly what I did :
I installed the last version of Node on a clear directory, created an application, and created the following json package file:
{
"name":"Radiorev",
"version":"0.0.1",
"private":"true",
"dependencies":{
"express":"3.3.5",
"socket.io":"0.9.16"
}
}
When I execute npm install, I get the following error:
spawnENOENT" error at the end of the installation
Why I am getting this error

Related

Electron fails to install on CI

After we migrated to Electron v11 for our project from v6, we started experiencing weird CI issues, where Electron did not install properly and the pipeline failed.
Our setup:
Lerna
Monorepo
Yarn v1.22
Private npm registry
Example of such issues:
[4/4] Building fresh packages...
error /builds/xxxx/..../node_modules/electron, /builds/.../node_modules/electron, /builds/xxxx/app/node_modules/electron: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: /builds/xxxx/features/yyyy/node_modules/electron
Output:
Error: dest already exists.
at /builds/xxxx/node_modules/fs-extra/lib/move/move.js:41:31
Exit code: 1
Command: node install.js
Arguments:
Directory: C:\gitlab\builds\pFMTxHs3\0\xxxxxx\features\yyyyy\node_modules\electron
Output:
C:\gitlab\builds\pFMTxHs3\0\xxxx\features\yyyyy\node_modules\electron\install.js:51
throw err
^
[Error: ENOENT: no such file or directory, open 'C:\Users\xxxx\AppData\Local\electron\Cache\httpsgithub.comelectronelectronreleasesdownloadv7.1.4electron-v7.1.4-win32-x64.zip\electron-v7.1.4-win32-x64.zip'] {
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'C:\\Users\\xxxx\\AppData\\Local\\electron\\Cache\\httpsgithub.comelectronelectronreleasesdownloadv7.1.4electron-v7.1.4-win32-x64.zip\\electron-v7.1.4-win32-x64.zip'
We tried deleting CI caches, Yarn caches, NPM caches all of that worked inconsistently. Sometimes we would have successful pipelines, sometimes not.
After a couple of months battling with this ghost, we had another error 5xx upon trying to download electron. It suddenly stopped downloading everywhere local machines and CI.
After getting in touch with the Electron team I discovered the problem.
We had a very old .npmrc config, which was no longer valid.
It contained this:
disturl=https://atom.io/download/electron
When I've changed the line into this:
disturl=https://electronjs.org/headers
All of our pain was gone - our builds became stable again.
Big thanks to the electron community!

vscode-ripgrep not getting installed in VSCode build/run process

I was trying to build and run VSCode on my Ubuntu 17.10 using the following guide: https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run
When I tried to install dependencies using yarn, it is giving me the following error:
error /home/dhairyakhale/git/vscode/node_modules/vscode-ripgrep: Command failed.
Exit code: 1
Command: node ./lib/postinstall.js
Arguments:
Directory: /home/dhairyakhale/git/vscode/node_modules/vscode-ripgrep
Output:
Unzipping to /home/dhairyakhale/git/vscode/node_modules/vscode-ripgrep/bin
And then it stops the process. How do I proceed?
I have a similar issue while installing Theia. The broken vscode-ripgrep installation caused it. Here is the ticket I submitted to vscode-ripgrep.
https://github.com/roblourens/vscode-ripgrep/issues/15

build error came after update node modules

Error on fetch for node_modules/angular2-notifications/src/simple-notifications.module.js at file:///D:/GIP/IMAGE PILOT/gipfe/node_modules/angular2-notifications/src/simple-notifications.module.js
Loading build/tmp/aot/src/app/app.module.ngfactory.js
Loading build\boot-aot.js
Error: ENOENT: no such file or directory, open 'D:\GIP\IMAGE PILOT\gipfe\node_modules\angular2-notifications\src\simple-notifications.module.js'
[10:13:51] 'build.aot' errored after 52 s
[10:13:51] Error in plugin 'run-sequence(bundle-aot)'
Message:
Error on fetch for node_modules/angular2-notifications/src/simple-notifications.module.js at file:///D:/GIP/IMAGE PILOT/gipfe/node_modules/angular2-notifications/src/simple-notifications.module.js
Loading build/tmp/aot/src/app/app.module.ngfactory.js
Loading build\boot-aot.js
ENOENT: no such file or directory, open 'D:\GIP\IMAGE PILOT\gipfe\node_modules\angular2-notifications\src\simple-notifications.module.js'
Details:
originalErr: Error: ENOENT: no such file or directory, open 'D:\GIP\IMAGE PILOT\gipfe\node_modules\angular2-notifications\src\simple-notifications.module.js'
Stack:
Error on fetch for node_modules/angular2-notifications/src/simple-notifications.module.js at file:///D:/GIP/IMAGE PILOT/gipfe/node_modules/angular2-notifications/src/simple-notifications.module.js
Loading build/tmp/aot/src/app/app.module.ngfactory.js
Loading build\boot-aot.js
Error: ENOENT: no such file or directory, open 'D:\GIP\IMAGE PILOT\gipfe\node_modules\angular2-notifications\src\simple-notifications.module.js'
import { SimpleNotificationsModule } from 'angular2-notifications';
imports: [
SharedModule,
routing,
ToastModule.forRoot(),
SimpleNotificationsModule.forRoot(),
this build error came when i take build npm run build.aot command. i put npm install command in my project then i try to take build error was came.
pls help me to resolve this
thank you.
Before i installed typescript version
"typescript": "^2.3.3" // package.json
then i changed the typescript version
"typescript": "2.3.3" //without cap symbol
Now,error was not came and i took build successfully

Error message from "jspm install jquery"

I am working through the tutorial on the jspm.io site
https://github.com/jspm/jspm-cli/wiki/Getting-Started
All works fine until I get to item 3, where I try to execute
jspm install jquery
and I get this error message
warn Error on getOverride for jspm:github, retrying (2).
ReferenceError: ui is not defined
at c:\Projects\Project1\node_modules\jspm\node_modules\jspm-registry\registry.js:157:5
nodejs is v0.12.0
npm is 2.5.1
jspm is 0.14.0
and this is on Windows 8.1
Does anyone have any clue what is causing this?
This looks like it was because there was an error while jspm was trying to create the local registry clone. Ensure you have git installed as git on your machine. Otherwise it may be a permissions issue.
This was a logging bug though - have fixed it with an update to the registry, so that the error should be slightly more useful next time if you update jspm.
I was getting a similar error with jspm but my problem was actually in how nodejs child_process.exec was calling the git command.
child_process.exec was running
C:\Windows\system32\cmd.exe /s /c "git clone --depth=1 github.com/jspm/registry.git .
However cmd.exe was still auto running commands set in the registry first. In my case the command changing the working folder. So the cwd was being overridden.
Check your registry settings for:
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
If there is a command in there to set the drive of working folder it will cause the above error.
Also
With your working folder as c:\, try ruuning the following nodejs code:
var exec = require('child_process').exec;
exec('dir', { cwd: 'C:/windows/fonts' }, function(error, stdout, stderr) {
console.log('stdout: ' + stdout);
});
If it does not list the contents of the fonts folder then your problem is more likely with child_process.exec in node

Trouble running Docco on Windows 7

I'm having trouble running Docco on Windows 7. I did the following:
downloaded and installed python and perl
installed node js
Run npm install -g coffee-script
Run easy_install pygments
Run npm install -g pygments
Run npm install -g docco
I navigated to the directory with javascript source:
C:\javascript>docco animation.js
docco: animation.js -> docs\animation.html
fs.js:427
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT, no such file or directory 'C:\javascript\docs\animation.html'
at Object.fs.openSync (fs.js:427:18)
at Object.fs.writeFileSync (fs.js:966:15)
at write (C:\Users\myaccount\AppData\Roaming\npm\node_modules\docco\docco.js:111:15)
at C:\Users\myaccount\AppData\Roaming\npm\node_modules\docco\docco.js:29:11
at fs.js:266:14
at Object.oncomplete (fs.js:107:15)
Any idea what the problem is?
Looking at the Docco sources, this is the problem:
ensureDirectory = function(dir, callback) {
return exec("mkdir -p " + dir, function() {
return callback();
});
};
In other words: it assumes that an executable called mkdir exists, and uses it to creates the necessary directories (including the output directory). But mkdir is a Unix-ism, and (usually) not available on Windows. So it fails (and since Docco isn't checking for any errors, it happily continues as if nothing happened...).
EDIT: seems these issues were fixed recently, so if you use the Github-hosted version of Docco you might get it to work.

Categories