I have installed the latets version of Node.js for Windows. Whatever command I use I always get the same exception, i.e. when I type "npm -v" get this error message:
Cannot find module 'es6-promisify'
How to install "es6-promisify" when NPM is missing "es6-promisify" in the first place?
BTW, during the installation of Node.js a view dependencies try to access protected foldes inside external hard drives for no reason and the last error that stuck forever was the installation of Microsoft Visual Studio Code. It seems to me that those tools cannot be installed without giving 100% access to every folder on every partition you have. This seems wrong to me...
Step 1: Uninstall the NodeJs app from the system
Step 2: Goto the programFiles/nodejs -> delete node_modules folder
Step 3: Reinstall NodeJs app
By following these steps you can fix the issue.
I found out a solution to this issue. I had to unplug all external drives, restart Windows, delete the folder "node_modules" manually and finally I started the Node.js msi to repair the installtion (copies files to node_modules again). After theses steps NPM is working again.
Remember: Reparing the installation without deleting the node_modules folder manually was not sufficient.
Pre-problem
I install npm and node using nvm, so that make my npm and node location in directory
npm /home/putrapc/.nvm/versions/node/v8.9.4/bin/npm
node /home/putrapc/.nvm/versions/node/v8.9.4/bin/node
all i install in stable version
The problem
I start using vs-code and there is always error notification that annoy me, like this
I realize that problem because the extension in vs-code like jsHint, flow, Javascript standard style, etc doesn't read any of my npm package properly. Yes it cause the directory isn't correct, how to change default read directory in vs-code ?
My eslint directory
/home/putrapc/.nvm/versions/node/v8.9.4/bin/eslint -> /home/putrapc/.nvm/versions/node/v8.9.4/lib/node_modules/eslint/bin/eslint.js
i had eslint installed as package, but the vs-code still didn't read it. How to correct this?
I was encountering similar issues with VS Code extensions encountering issues when trying to run Node with error messages such as
/usr/bin/env: ‘node’: No such file or directory
The simplest solution I found to this is to use a terminal to start Visual Studio in the folder that you're trying to open from
This can be done by navigating to the folder you're trying to open in Code, opening a terminal there, and typing in
$ code .
The above behaviour seems to happen because NVM sets its own variables for the node location and that is what is used by default in your terminal session. You can check these using
env | grep NVM
This returned the following for me
NVM_DIR=/home/saikat/.nvm
NVM_CD_FLAGS=
NVM_BIN=/home/saikat/.nvm/versions/node/v12.0.0/bin
Also, trying to get the current Node location using which returns the following
$ which node
/home/saikat/.nvm/versions/node/v12.0.0/bin/node
When starting Visual Studio Code from anywhere apart from the terminal, the above NVM variables don't get set and hence the extensions try to find node at the default location /usr/bin/env and are unable to find it there and hence fail
I have been using Yeoman to start building with web apps and such for maybe the last month. And I have been running into some issues and have been able to resolve most of them. However, now I am stuck.
I'm running MAC OS 10.6.8
I have reinstalled Yeoman and Node fixed my paths for (what I know) as global.
Running grunt in my app.
Forces me to run as sudo. (I think this is because this OS has password protected permissions for apps and programs to install/modify files.
** If I run grunt -f
Warning: Unable to write "dist/scripts/vendor/modernizr.js" file (Error code: EACCES). This error happens with most of the main tasks in grunt.
Running sudo grunt
grunt runs through the tasks just fine until the real issue I cannot locate an answer.
Running "modernizr" task
Enabled Extras
shiv
load
cssclasses
Looking for Modernizr references
in dist/styles/main.css
svg
input
Downloading source files
cache modernizr.load.1.5.4.js
And grunt will not finish this download of source files. When I ran grunt using force it would complete the download. I am looking for a solution for the 2nd list item. Any assistance would be helpful.
Found out that there some glitch in the npm grunt-modernizr.
I used this code:
npm remove grunt-moderizr && npm install --save-dev grunt-modernizr
found here: https://github.com/Modernizr/grunt-modernizr/issues/48
New Grunt user here who is using a lot of new tools (npm nodejs) today.
I've got Grunt "installed" and have been able to create a grunt.js file using the init task as described here: http://net.tutsplus.com/tutorials/javascript-ajax/meeting-grunt-the-build-tool-for-javascript/ and here: https://github.com/cowboy/grunt/blob/master/docs/getting_started.md. But whenever I run the "grunt" command I get an error:
Windows Script Host
Script: c:\users\[]\Documents\code\grunt\grunt.js
Line: 2
Char: 1
Error: 'module' is undefined
Code: 800A1391
Source: Microsoft JScript runtime error
As explained in the FAQ, you need to type grunt.cmd instead on Windows because the OS tries to launch grunt.js
Or you can install grunt-cli globally instead. This package will run any version of Grunt if it's been installed locally to your project.
SOLVED !!
So, this problem occur because windows by default associative < *.js > files
with >>
"Microsoft Windows Based Script Host".
grunt need to open by default with (grunt.cmd).
it easy to slove, by change default app (open with..)
Guide :
Go to any javascript file with "js" extension. (any file)
Right-Click(mouse) > Properties > "Opens with:" Change...(button)
Choose Notepad ( or any javascript IDE ).
PROBLEM SOLVED ! :)
good luck
If you're getting a "Microsoft JScript runtime error" that means that node.js isn't even getting invoked; instead Windows Script Host is trying to run your code. That's probably a problem with filetype associations; IIRC Windows defaults to trying to execute a ".js" file with WSH. You may wind up having to create a shortcut to your script, specifying a command line (probably something like "node %1") and a starting directory in order to make sure that it's executed properly.
It would help if you could tell us exactly how you're trying to invoke your code.
it seems that in the latest versions of the grunt modules, you would have to do the following to have it work under windows:
remove any globally installed grunt
npm uninstall -g grunt
install grunt-cli globally
npm install -g grunt-cli
install grunt locally into your project
npm install grunt
installing grunt (v0.4.x) globally does not seem to create the necessary grunt.cmd anymore. it seems that the recommendation is now to have grunt installed locally to be able to use version-specific Gruntfiles
As Florian F suggested, running grunt.cmd works. This is because of the process Windows is looking for your grunt command.
When typing grunt -h Windows will proceed to look for the following files:
./grunt.cmd
./grunt.* (grunt.js is found in this case which is why you see "module is undefined")
%APPDATA%/npm/grunt.cmd
An alternative to using "grunt.cmd" is to use grunter which simply renames the command to grunter... then you no longer have this problem.
To answer this, first we need to understand that the error is caused because it is being executed by Windows Script Host.
Now, run the code from your cmd promt with the following syntax:
>node <application_name>.js
this will allow the Node.js application to open through V8 JavaScript engine(Google's).
P.S: Please reply back if this has helped in resolving your issue else post the problem you are facing after trying this.
I had a similar issue, the problem is file association, I would recommend:
right click on a .js file and choose open with.
then you choose nodejs/node.exe (somewhere in "program files" folder
then make tick box where it says "always open .js files " (paraphrasing)
That should do the trick.
I went through the same issue when running an old Node project.
The issue was with the name of the js file, it was node.js. So the while running the command node node.js, it was opening up a windows dialogue box.
I just changed the name of the file to app.js and the error flew away.
So, in my case i had tryed all the mentioned above with no result.
But i have fund that im dont type: node in the full sentence as the following snipet
node script.js.And remember never understimate your own miscoding.
Solution:
Go to any javascript file with "js" extension. (any file)
Right-Click(mouse) > Properties > "Opens with:" Change...(button)
Choose Notepad ( or any Javascript IDE like VS Code ).
probably a stupidd question. I have installed node.js on my Windows 7 machine and and trying to install derbyjs. i ran the "npm install -g derby" command and everything seemed fine.
Now when i try to create a new app via
derby new --coffee testProj01
it gives me the error that derby is not a recognized command. I tried running the new project command from the node_modules/derby/bin directory as well. now it shows the "choose an application to open selected file" popup.
i guess the problem is that there is no exe in the bin folder. Am i supposed to build derby before i can work on it?
How do I do that?
Derby and the libraries it depends on are now working again on Windows as of v0.3.8. Do a node install and a npm update and you should be good.
See https://github.com/codeparty/derby/issues/42 for background.