I have a Openlayers package installed in my server and running npm install
but i get
> closure-util update
sh: 1: closure-util: Permission denied
I have done proxy settings as
npm config set registry http://registry.npmjs.org/
npm config set https-proxy https://proxy.companyName.com:port
But still getting same issue
Looks like you are using the openlayers package, which is deprecated. Try npm install ol to use the ol package instead.
Related
Is there a way to install NPM command line tools on NixOS?
[root#ip-xxx-xxx-0-27:~/teros/ntrs-cli]# sudo npm i -g typescript
npm WARN checkPermissions Missing write access to /nix/store/rhikjv5vlpa6vq4qkrszinwsaz1mda7p-nodejs-8.15.1/lib/node_modules
npm ERR! path /nix/store/rhikjv5vlpa6vq4qkrszinwsaz1mda7p-nodejs-8.15.1/lib/node_modules
npm ERR! code EROFS
npm ERR! errno -30
npm ERR! syscall access
npm ERR! rofs EROFS: read-only file system, access '/nix/store/rhikjv5vlpa6vq4qkrszinwsaz1mda7p-nodejs-8.15.1/lib/node_modules'
npm ERR! rofs Often virtualized file systems, or other file systems
npm ERR! rofs that don't support symlinks, give this error.
I assume because it's read-only, because I did run:
chown -R `whoami` nix/store/rhikjv5vlpa6vq4qkrszinwsaz1mda7p-nodejs-8.15.1
as an aside if someone knows how to install Node.js version 11 or 12 on nixos that'd be great.
Firstly, please undo the permissions change (chown) you made. You should NEVER change the permissions of files in the Nix store (/nix/store).
To install NPM packages on NixOS use the corresponding Nix package, instead of using npm -g .... NPM packages are under the nodePackages "namespace".
For example, to install typescript (tsc) edit /etc/nixos/configuration.nix:
...
environment.systemPackages = with pkgs; [
...
nodePackages.typescript;
]
...
Then use nixos-rebuild switch to "install" the package.
You can install Node.js the same way. Use nix search nodejs to see the various versions you can install.
Instead Edit ~/.npmrc so that it tells npm to install and find "global" packages in your home folder instead of the root location:
prefix=~/.npm-packages
now any time you run npm i -g <some-package> you will see that it will be installed inside of ~/.npm-packages.
Now in your shell rc file (f.e. .bashrc or .zshrc or similar), you'll need to update your PATH to include executables from the new location:
### Add NPM executables to your PATH so that they are available as commands:
export PATH="$HOME/.npm-packages/bin:$PATH"
Often it is more convenient to manage ephemeral dependencies outside of the system-level package manager.
If you use something like n or nvm to manage specific node versions, you can do a similar thing by managing them in your home folder.
npm config set prefix '~/mutable_node_modules'
This thread should be helpful:
https://github.com/NixOS/nixpkgs/issues/3393#issuecomment-50330167
https://github.com/NixOS/nixpkgs/issues/3393#issuecomment-187510024
You can also install them with the usual npm -i..., just without the -g (global) paramater.
looks like things may have changed a bit.
on fish shell with node v16.15.0 and nix (Nix) 2.8.1. I just had to add fish_add_path -g $HOME/.node_modules/bin to my config.fish then npm install -g <package>.
I am using Mac OS Sierra v10.12 and getting error while adding to my Phonegap project within the folder myApp:
$ node -v
v7.2.0
$ npm -v
3.10.9
$ cordova platform add ios
received following errors:
Error during untar for /Users/{user_name}/.cordova/lib/npm_cache/cordova-ios/4.3.0/package.tgz: Error: EACCES: permission denied, open '/Users/{user_name}/.cordova/lib/npm_cache/cordova-ios/4.3.0/package/package.json'
Error: Failed to fetch platform ios
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: EACCES: permission denied, open '/Users/{user_name}/.cordova/lib/npm_cache/cordova-ios/4.3.0/package/package.json'
Note: {user_name} is my mac user Id, Can anybody help me!
I think you have to issue with permission to add platform .
Try to following :
$sudo chown -R {user_name} /Users/{user_name}/.cordova/lib/npm_cache/
For more please check here.
Hopes this will help you !
Maybe this is a cache problem of cordova. Delete the cache and try to add the platform again:
rm -rf ~/.cordova
Try upgrading npm, this worked for me:
npm install npm#latest -g
I am trying to set up for the react native. but whenever I update files it gives m error
enoent ENOENT: no such file or directory, open 'React Native/package.json'
npm WARN react-native#0.26.3 requires a peer of react#15.0.2 but none was installed.
npm WARN React Native No description
npm WARN React Native No repository field.
npm WARN React Native No README data
npm WARN React Native No license field.
MacBook-Pro:React Native$ npm info react dist-tags.latest
Please let me know how can I fix.
Installing react should fix the error
npm install react --save
Also, you may try upgrading your react-native install. react-native is as v0.30.0 now
npm update react-native
In my specific case I was running npm install in the wrong directory. I thought I was in my project directory but was one level higher. This meant react was missing from installed packages (because there were none) and thus gave this error.
Some steps that worked for me:
1. watchman watch-del-all
2. rm -rf node_modules
3. npm install react#15.0.2 --save
4. npm install react#15.1.0 --save
5. npm install
6. rm -fr $TMPDIR/react-*
7. npm start -- --reset-cache
In my case, the project I am working on requires a specific version of React. Since it was older than the current release, doing an install/update would still cause the error.
In order to fix the problem, I had to check the package.json of the project and install the exact version allowed by the dependency definition. In the OP's case, a
npm install react#15.0.2
should fix the problem by installing the exact version of the React module that react-native requires.
Verify that the condition was resolved by doing a npm list to see if there are any other unmet peer dependencies.
I followed this tutorial to install yeoman, bower, grunt to setup angularjs corodva project. http://www.sitepoint.com/kickstart-your-angularjs-development-with-yeoman-grunt-and-bower/
as it says i installed everything but still it gives me error! while creating angular project.
I did,
My PC is running windows 8.1 64 bit
Install node.js using windows installer (64 bit)
Install git (selected windows commandline instead git bash while installing)
npm install -g yo grunt-cli bower
I cross checked everything whether it is installed
C:\Windows\system32>yo --version && grunt --version && bower --version
yo - 1.4.7
grunt-cli v0.1.13
bower - 1.4.1
4. npm install -g generator-angular
created a dir in c and installed yo angular
C:\test\yo angular
It asked for sass (i given NO), bootstrap (YES), other angularjs library (NO) then it started installing
then after sometime, it asks that my package.json should overwrite i gave yes
after the few files generated then shows ERR!
npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/wrappy/1.0.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/brace-expansion/1.1.0/package.tgz
npm ERR! tar.unpack untar error /root/.npm/delayed-stream/0.0.5/package.tgz
npm WARN optional dep failed, continuing form-data#0.1.4
npm ERR! tar.unpack untar error /root/.npm/is-property/1.0.2/package.tgz
npm WARN optional dep failed, continuing request#2.54.0
As Prasanth says, The best way is to do the following:
npm cache clean
double checked whether everything is installed
also try close then re-open cmd as administrator
When angular asks for overwrite package.json, Say n to all
Still faces issue, then try this
make sure Grunt is installed
npm install (it will install missing packages)
I followed the link below to install npm
http://shapeshed.com/setting-up-nodejs-and-npm-on-mac-osx/
Node -v 0.8.2 was installed properly.
Then I used the following command to install npm
curl http://npmjs.org/install.sh | sh
but I got an error saying -
Failed to get tarball url for npm/1.1
I also cloned npm from github and then did make install but it stopped at the third line shown below.
npm http GET https://github.com/isaacs/ronnjs/tarball/master
npm http 200 https://github.com/isaacs/ronnjs/tarball/master
npm http GET https://registry.npmjs.org/opts
After trying for sometime I then downloaded the install.sh file and then changed
https://registry.npmjs.org/ to http://registry.npmjs.org/ at all places.
Then as a root user I ran the following command
bash path_to_install.sh
and npm -v = 1.1.42 was installed
But when I tried to install juggernaut with the following command
npm install -g juggernaut
It gets stuck at the following line and nothing happens.
npm http GET https://registry.npmjs.org/juggernaut
I guess the problem is with the https url or the way I installed npm.
How can I fix this problem.
Any help would be appreciated.
It worked when I replaced https://registry.npmjs.org to http://registry.npmjs.org inside npm.