'rollup' is not recognized as an internal or external command - javascript

I would like to ask if how should I fix this issue because I am already stuck and confused about this part. I already installed rollup globally using this command
npm install --global rollup
However when I tried to run the 'rollup' command then I should expect the rollup information or something will show in my CLI? but my CLI shows
'rollup' is not recognized as an internal or external command,
operable program or batch file.
What I have done so far is.
Updated the NPM
Reinstall the rollup globally.
I already read some documentation but the issue is still showing.https://github.com/Esri/ago-assistant/issues/176
Please enlighten me.
Thank you

What I just have done just to run the script globally.
I just added these scripts in my package.json to run the rollup using NPM.
"scripts": {
"rollup": "rollup"
is this okay?

Try restarting your terminal
Try locating where the Rollup binary is installed
%AppData%\npm\node_modules or %AppData%\roaming\npm\node_modules
and run it manually like
%AppData%\npm\node_modules\rollup\bin\rollup.exe

npm install
fixed this issue for me

Related

why can't Gatsby command work even if I have installed it?

I have followed a tutorial to create a folder that holds all npm globally installed, but I still can't run gatsby command even if I have installed gatsby-cli. What is wrong?
It seems that your environment does not recognize gatsby command.
Try this:
npm install -g gatsby-cli
If the error persists, try to close and reopen the shell, sometimes it caches the previous state.
You can check for further details here.

Pointing package.json to a specific React commit installs react-tools (not react)

When I add this line to my package.json:
"react": "git://github.com/facebook/react.git#08e4420019f74b7c93e64f59c443970359102530"
...and then run npm install, I find node_modules/react-tools installed when I expect to see node_modules/react.
What am I doing wrong here?
The code at git://github.com/facebook/react.git is not the same code that gets installed when you npm install react. Instead, the code contains a series of build steps that are used to build the npm package. As far as I know, there is not a way to easily use a specific SHA of the React repo as an npm package; you would need to clone the repo, build the project, and copy it somewhere you can require it.

Grunt.js Installation Issue - Command Not Found

I'm trying to get grunt.js set up on my work machine. Now I've managed to get it set up at home, so I pushed my repository, then cloned it on my work machine, however despite troubleshooting this to death I've always run into the same issue when I come to try and run the command on my work computer;
sh.exe": grunt: command not found
So some background and explanation;
I'm using Aptana 3.0 and running all my commands through the terminal. (This applies to my home and work computer)
I cloned the "working" repository and put it in a folder on my work machine, so I have my package.json and gruntfile.js files inside said directory. These work fine on my home computer and I am able to run the watch task set up in my gruntfile.js successfully at home.
I've run npm install grunt-cli -g and npm install inside my project on my WORK computer and installation has been successful each time. My only error messages on either are a lack of description and a repository field which, to my knowledge these aren't mandatory?
The node modules folder inside my repository indicates I have the following installed (as per my package.json)
grunt
grunt-contrib-compass
grunt-contrib-uglify
grunt-contrib-watch
matchdep
Now I'm pretty green to this command line stuff, so I may have overlooked something very obvious but I feel like I've tried every guide going to get this thing to work.
Despite running through the getting started steps/installing grunt documentation repeatedly, it seems no matter what I do the terminal will not pick up grunt as a recognized command.
Am I stupid or is this some other issue?
EDIT 1: contents of my package.json:
{
"name" : "xxxxxxxxx",
"version" : "xxxx",
"dependencies" : {
"grunt":"~0.4.1",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-compass": "~0.5.0",
"grunt-contrib-uglify": "~0.2.2",
"matchdep": "~0.1.2"
}
}
This is happening because you are using the Aptana Terminal, which needs the PATH variable to work out what is meant by grunt etc. A normal cmd prompt would work fine with the command npm install grunt-cli -g but in this context the terminal is unaware of what grunt is.
As per the following existing answer, you need to set up your Windows PATH variable to make the Aptana Terminal aware of the npm directory: https://stackoverflow.com/a/19137584/463205
C:\Users\Username\AppData\Roaming\npm
Closing the terminal and reopening it after setting the PATH correctly should enable you to run the command successfully.
Try to run
npm install grunt-cli -g
On your home computer.
-g means - install Grunt globally (not in the project node_modules folder), so it'll add grunt command to the bin folder which is used by nodejs console ( and you need to run node.js command prompt, not just arbitrary cmd)

Browserify command not found

Quick question, when I run browserify index.js -o app.js from mac terminal, I get command not found. I have done npm install -g browserify but still no luck. Any idea why I am getting this?
Thank you
It was easier for me to do a gist than to paste here:
https://gist.github.com/pertrai1/4ccf77e7b31cb5628b5d
Just install it in a global space like this if you need to run it from the command line.
npm install browserify -g
You may need to run
npm uninstall browserify -g fist just to be sure you don't have false aliases.
Add this to your ~/.bashrc or equivalent:
export PATH=$PATH:~/.npm-global/bin/
Then, to actually have this take effect in your terminal session, execute source ~/.bashrc.
At this point you can execute browserify, as well as potentially many other commands. Check out ~/.npm-global/bin/ to see what's become available.
I could not get browserify to work either.
Running ~/.npm/bin/browserify does work.
Other packages seem to run fine (phantomjs for instance).
A workaround fix seems to be adding alias browserify='~/.npm/bin/browserify' to your .bash_profile
It is an old post but I believe people are still facing the same problem, like me.
This was how I solved my problem:
<your project folder>/node_modules/browserify/bin/cmd.js main.js -o bundle.js
If you install locally npm install browserify, you can use this method to execute the browserify command.
node_modules/.bin/browserify
For example:
broweserify command example
Extra tips:
Add this command to your packages.js file:
...
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"bundle": "node_modules/.bin/browserify index.js > bundle.js"
},
Then everytime you want to bundle you file just hit npm run bundle
Hope it helps you guys out there..
If for some reason the browserify command has not been installed at all (can happen for example if you're running Homebrew on old unsupported Mac OS X versions), an alternative is to call it via node, for example:
export NODE_PATH=/usr/local/share/npm/lib/node_modules
node -e 'require("browserify")("input.js").bundle().pipe(fs.createWriteStream("output.js"))'
As a Mac user I had to add
export PATH=$PATH:/usr/local/Cellar/node/13.6.0/bin/
in ~.bash_profile
Why Cellar path i dont know.

Node.js says it can't load sqlite3 module, but does anyway

I'm working with the new Node.js Tools for Visual Studio and included the sqlite3 npm module. When I call require('sqlite3') it throws the error:
Error: Cannot find module './binding\Debug\node-v11-win32-ia32\node_sqlite3.node'
Odd thing is, when I ignore the error and continue running the code, everything works fine...until the function I'm in returns; then the server crashes.
Has anyone else had this issue? I have a suspicion that it has something to do with the ./binding part, but wouldn't know where to begin in terms of finding out why.
use this:-
npm install sqlite3 --build-from-source
This is what worked for me: https://www.npmjs.com/package/sqlite3
npm install https://github.com/mapbox/node-sqlite3/tarball/master
From: https://github.com/mapbox/node-sqlite3/wiki/Building-On-Windows
Install required software:
Python 2.x: https://www.python.org/downloads/release/python-2711/
Win SDK: http://www.microsoft.com/en-us/download/details.aspx?displayLang=en&id=8279
Microsoft Visual Studio 2010+: https://www.microsoft.com/es-es/download/details.aspx?id=48217
Build:
npm install sqlite
npm install
node-gyp configure build
I got the kind of problem, my node version is v10.16.3
This globally installed sqlite3 gives error in loading by require('sqlite3')
It been solved by install a sqlite3 local to project.
$ npm install sqlite3
Note without -g option, it works for me.
It seems this is a problem with the sqlite3 npm package itself. There exists a lib\binding\Release\ folder, but not a lib\binding\Debug\ folder. I just created a copy of the Release folder, named it Debug, and all is well.
In case this above has not worked for anyone, here is what worked for me:
sudo apt install node-sqlite3
(I am using Ubuntu with Vscode as editor). It seems installing this node-sqlite3 module was the one that was recognized.
To skip searching for pre-compiled binaries, and force a build from source, use
npm install --build-from-source

Categories

Resources