Installing Inotify with NPM - javascript

I'm quite new to nodeJS and I'm trying to install a package called inotify using the Node Package Manager (NPM).
After installing NPM (on OSX Lion), I tried to install inotify with the command:
sudo npm install inotify
And I get the following error:
npm http GET https://registry.npmjs.org/inotify
npm http 304 https://registry.npmjs.org/inotify
> inotify#0.2.2 install /usr/local/lib/node_modules/inotify
> node-waf configure build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local/Cellar/node/0.6.6
Checking for program node : /usr/local/bin/node
Checking for function inotify_init : not found
/usr/local/lib/node_modules/inotify/src/wscript:11: error: the configuration failed (see '/usr/local/lib/node_modules/inotify/build/config.log')
npm ERR! error installing inotify#0.2.2
npm ERR! inotify#0.2.2 install: `node-waf configure build`
npm ERR! `sh "-c" "node-waf configure build"` failed with 1
npm ERR!
npm ERR! Failed at the inotify#0.2.2 install script.
npm ERR! This is most likely a problem with the inotify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls inotify
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Darwin 11.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "inotify"
npm ERR! cwd /Users/username/code
npm ERR! node -v v0.6.6
npm ERR! npm -v 1.1.4
npm ERR! code ELIFECYCLE
npm ERR! message inotify#0.2.2 install: `node-waf configure build`
npm ERR! message `sh "-c" "node-waf configure build"` failed with 1
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/username/code/npm-debug.log
npm not ok
Can someone help me out with this

The inotify module won't build because it can't find inotify_init. This is because inotify is not available on OS X.
The FSEvents API on OS X provides similar functionality, but it's a completely different API. The inotify module is not going to work in this situation.
Depending on what you are trying to do, fs.watch might suit your needs. It abstracts away platform differences:
On Linux systems, this uses inotify.
On BSD systems (including OS X), this uses kqueue.
On SunOS systems (including Solaris and SmartOS), this uses event ports.
On Windows systems, this feature depends on ReadDirectoryChangesW.

Related

I have this error message "npm ERR! Linux 5.4.72-microsoft-standard-WSL2" on my terminal when I run "npm install"

I have this error message : npm ERR! Linux 5.4.72-microsoft-standard-WSL2 on my terminal when I run npm install. I'm on a vue.js app and I have this message since I installed vuetify.
Here is the whole error message :
npm ERR! Linux 5.4.72-microsoft-standard-WSL2
npm ERR! argv "/home/josephine/.nvm/versions/node/v14.15.0/bin/node" "/home/josephine/.nvm/versions/node/v14.15.0/bin/npm" "install"
npm ERR! node v14.15.0
npm ERR! npm v3.10.10
npm ERR! cb.apply is not a function.
I also cannot install the latest version of npm I think this is related to the problem. (I have this version v3.10.10).
And when I run npm run serve I have this :
> vue-cli-service serve
sh: 1: vue-cli-service: not found
npm ERR! Linux 5.4.72-microsoft-standard-WSL2
npm ERR! argv "/home/josephine/.nvm/versions/node/v14.15.0/bin/node" "/home/josephine/.nvm/versions/node/v14.15.0/bin/npm" "run" "serve"
npm ERR! node v14.15.0
npm ERR! npm v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! my-app#0.1.0 serve: vue-cli-service serve
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the my-app#0.1.0 serve script 'vue-cli-service serve'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the my-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! vue-cli-service serve
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs my-app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls my-app
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?`.
I have the Vue.JS version # vue / cli 4.5.12.
At last, I have a Window PC and I have installed linux and ubuntu.
I thank you in advance if you can help me.
Your npm version is outdated. Your version is 3.x but we're currently at 7.x
Run
npm update -g
and then try again.

Cannot install electron in Ubuntu

My npm version is 3.10.10
And node version is v7.2.1
And when I tried to install electron in ubuntu via :
sudo npm install electron --save-dev
I get error like this :
Error: read ECONNRESET
at exports._errnoException (util.js:1022:11)
at TLSWrap.onread (net.js:572:26)
npm WARN enoent ENOENT: no such file or directory, open '/home/dotmark/package.json'
npm WARN dotmark No description
npm WARN dotmark No repository field.
npm WARN dotmark No README data
npm WARN dotmark No license field.
npm ERR! Linux 3.13.0-87-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "electron" "--save-dev"
npm ERR! node v7.2.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! electron#1.4.13 postinstall: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron#1.4.13 postinstall script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs electron
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls electron
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/dotmark/npm-debug.log
You can't add a module to the dependencies of the package you are writing (--save-dev) unless you first create a package (with npm init or by manually writing a package.json).
… but don't make the root of your package your own home directory. Create a directory for it.

Command 'export' not recognized after 'npm run build' with webpack

We want to use webpack in our project. It has already been partly integrated as a test on a Mac and it works.
When using the same branch on my Windows machine I get following error message.
Webpack version ist 1.12.15
The part in German means that command 'export' could not be recognized or was not written correctly.
S:\project>npm run build
> project#version build S:\project
> export NODE_ENV=dev && webpack
Der Befehl "export" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\someone\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v4.4.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! project#version build: `export NODE_ENV=dev && webpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the project#version build script 'export NODE_ENV=dev && webpack'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the onedata package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! export NODE_ENV=dev && webpack
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs project
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls project
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! S:\project\npm-debug.log
It is not possible to use the newest node.js, as some other packages are incompatible to it.

Azure deploy error errno 47

I'm trying to deploy a nodeJS application in azure. In deployment i have the npm ERR! errno 47.
Maybe can help that i had exceded the maximum character paths while developing, which i fixed it locally.
All answers would be appreciate.
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling node.js deployment.
KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot'
Copying file: 'index.js'
Copying file: 'mmfrontend-crm-node.njsproj'
Copying file: 'package.json'
Node.js versions available on the platform are: 0.6.17, 0.6.20, 0.8.2, 0.8.19, 0.8.26, 0.8.27, 0.8.28, 0.10.5, 0.10.18, 0.10.21, 0.10.24, 0.10.26, 0.10.28, 0.10.29, 0.10.31, 0.10.32, 0.12.0.
Selected node.js version 0.10.32. Use package.json file to choose a different version.
Updating iisnode.yml at D:\home\site\wwwroot\iisnode.yml
npm WARN package.json mmfrontend-crm-node#1.0.0 No description
npm WARN package.json mmfrontend-crm-node#1.0.0 No repository field.
npm WARN deprecated gulp-clean#0.3.1: use gulp-rimraf instead
npm WARN engine imagemin#2.2.1: wanted: {"node":">=0.10.0","npm":">=2.1.5"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN optional dep failed, continuing imagemin-pngquant#4.0.0
npm WARN optional dep failed, continuing imagemin-optipng#4.2.0
npm WARN optional dep failed, continuing imagemin-jpegtran#4.1.0
npm WARN optional dep failed, continuing imagemin-gifsicle#4.1.0
npm ERR! EEXIST, open 'D:\local\AppData\npm-cache\5428a087-m-cache-wrappy-1-0-1-package-tgz.lock'
File exists: D:\local\AppData\npm-cache\5428a087-m-cache-wrappy-1-0-1-package-tgz.lock
Move it away, and try again.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "D:\\Program Files (x86)\\nodejs\\0.10.32\\node.exe" "D:\\Program Files (x86)\\npm\\1.4.28\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
npm ERR! cwd D:\home\site\wwwroot
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! path D:\local\AppData\npm-cache\5428a087-m-cache-wrappy-1-0-1-package-tgz.lock
npm ERR! code EEXIST
npm ERR! errno 47
Failed exitCode=47, command="D:\Program Files (x86)\nodejs\0.10.32\node.exe" "D:\Program Files (x86)\npm\1.4.28\node_modules\npm\bin\npm-cli.js" install --production
An error has occurred during web site deployment.
Redeploy worked, a bit strange with azure

Can't install js-bson

I am using Windows 7 64bit, trying to install bson as a dependencie of mongodb.
I get this error:
npm WARN package.json Wochenplaner#0.0.1 No README.md file found!
npm http GET https://registry.npmjs.org/bson
npm http 304 https://registry.npmjs.org/bson
bson#0.1.5 install C:\Users\Administrator\Dropbox\Projekte\Wochenplaner\node_m
odules\bson
node install.js || (exit 0)
CreateProcessW: Das System kann die angegebene Datei nicht finden.
npm ERR! error rolling back Error: ENOTEMPTY, rmdir 'C:\Users\Administrator\Drop
box\Projekte\Wochenplaner\node_modules\bson'
npm ERR! error rolling back bson#0.1.5 { [Error: ENOTEMPTY, rmdir 'C:\Users\Adm
inistrator\Dropbox\Projekte\Wochenplaner\node_modules\bson']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: 'C:\Users\Administrator\Dropbox\Projekte
\Wochenplaner\node_modules\bson' }
npm ERR! bson#0.1.5 install: node install.js || (exit 0)
npm ERR! cmd "/c" "node install.js || (exit 0)" failed with 127
npm ERR!
npm ERR! Failed at the bson#0.1.5 install script.
npm ERR! This is most likely a problem with the bson package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js || (exit 0)
npm ERR! You can get their info via:
npm ERR! npm owner ls bson
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nod
ejs\node_modules\npm\bin\npm-cli.js" "install" "bson"
npm ERR! cwd C:\Users\Administrator\Dropbox\Projekte\Wochenplaner
npm ERR! node -v v0.8.16
npm ERR! npm -v 1.1.69
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\Administrator\Dropbox\Projekte\Wochenplaner\npm-debug.log
npm ERR! not ok code 0
I get this log: http://pastebin.com/B6F2C5um
What is the problem?
Also: I tried to install versions 0.1.1, 0.1.2, 0.1.3 etc.
I was having the same exact issue and remembered I had fiddled with my PATH variable, recently. It was failing to run cmd.exe.
It was fixed after adding c:\windows\system32 to my PATH.
Per below (note the node issue mentions socket.io, which was also causing similar problems when I tested it):
https://github.com/joyent/node/issues/4222
Try deleting C:\Users\Administrator\Drop
box\Projekte\Wochenplaner\node_modules and reinstalling.
I just installed the bson package on my Win7 (64bit also) box without any issues.
Check the following points.
Is your node executable accessible from everywhere? (check with opening a command line and just type node + Enter, if a shell pops up you should be fine)
Do you have sufficent access rights for the target folder in question?
Since the main error seems to be CreateProcessW: Das System kann die angegebene Datei nicht finden., i'm pretty sure the first point is the issue.
You could fix that easily by either re-installing node.js or adding the path to your node executable manually to the PATH environment variable.

Categories