Using yeoman in VM causes error... - web

I am successfully running this on Linux so this is pure Windows problem. Running vagrant fedora box in windows 7 using nvm (node 0.10.35) give me ERR! tar.unpack untar error starting with grunt-contrib-imagemin module.
Addressed issues ran as non sudo as it was suggested in numerous posts. As my installation on Linux flawlessly installs on Windows I run into issues after running yo webapp
vagrant up vagratn ssh nvm use 0.10.35
yo webapp on windows I get these starting errors
first error:
tar.unpack untar error /home/vagrant/.npm/set-immediate-shim/1.0.0/package.tgz second verbose stack error:
EPERM, open '/home/vagrant/workspace/webapp/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-jpegtran/node_modules/jpegtran-bin/node_modules/bin-build/node_modules/download/node_modules/download-status/node_modules/object-assign/package.json'
and then it goes crazy on grunt-contrib-imagemin.
I am aware of symlink issues in VM and heard of some long paths issues with grunt-contrib-imagemin but I have no direction how to continue debugging.
node -v v0.10.35 npm -v 2.1.17 yo -v 1.3.3 bower -v 1.3.12 grunt --version grunt-cli v0.1.13 Any help is appreciated..

May not be ideal, but I was able to get this working by giving Vagrant user ownership of my project directory.
sudo chown -R vagrant:vagrant /link/to/project

Related

npm commands not working on Bash on Ubuntu on Windows (WSL)

I am running latest stable windows with bash on Ubuntu running through cmder wslbridge (i tried running directly through bash but same errors). Moving to my windows based react-native folder and trying to run some cli like npm run android , react-native run-android , gradlew clean is always producing errors;
while surprisingly some other commands like npm start work properly...
which npm print out; /usr/local/bin/npm
i have npm installed on windows and inisde Ubuntu and whereis npm produce this
I am really confused here; when running npm commands inside the bash onto windows folders which npm should be triggered? the windows or WSL one?!
I've tried a lot of suggested solution, but nothing seems to be working...
As you have said you are unsure what is actaully running when you run the commands. if you run the following commands it might make it clear as to what is actually running.
➜ ~ whereis npm
npm: /usr/local/bin/npm /home/damo/.nvm/versions/node/v8.11.1/bin/npm /mnt/c/Program Files/nodejs/npm /mnt/c/Program Files/nodejs/npm.cmd
➜ ~ which npm
/home/damo/.nvm/versions/node/v8.11.1/bin/npm
➜ ~ npm --version
6.4.1
➜ ~ sudo find / -name npm
/home/damo/.npm/10.52.63.39_4783/npm
/home/damo/.npm/npm
/home/damo/.nvm/versions/node/v10.4.1/bin/npm
/home/damo/.nvm/versions/node/v8.11.1/bin/npm
/home/damo/.oh-my-zsh/plugins/npm
/mnt/c/Program Files/nodejs/node_modules/npm
/mnt/c/Program Files/nodejs/node_modules/npm/bin/npm
/mnt/c/Program Files/nodejs/npm
/mnt/c/Users/stangerd/AppData/Roaming/npm
➜ ~ echo $PATH
/home/damo/.nvm/versions/node/v8.11.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/cmder/vendor/conemu-maximus5/ConEmu/Scripts:/mnt/c/Program Files/cmder/vendor/conemu-maximus5:/mnt/c/Program Files/cmder/vendor/conemu-maximus5/ConEmu:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/HashiCorp/Vagrant/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/nodejs:/mnt/c/Program Files/Beyond Compare 4:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/Microsoft VS Code/bin:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/Users/ stangerd/AppData/Roaming/npm
➜ ~ nvm use 10
Now using node v10.4.1 (npm v6.1.0)
➜ ~ echo $PATH
/home/damo/.nvm/versions/node/v10.4.1/bin:/usr/local/sbin:/usr/local/bin:........
You can see that for me i also have many versions of npm, but that its my WSLs current nvm version that is being used (shown by running which npm). This is because when the path is searched the first one found will be used. the first instance of npm in all the folders in my path is in /home/damo/.nvm/versions/node/v8.11.1/bin. Notice that when using nvm the path will be changed when switching node versions and that conveniently it puts this new path on the front of all the existing path folders.
Its also worth checking the alias set as this gets evaluated before the path is even queried. Just run alias to get a list.
Hope that this helps to find what is actually running. I'm interested to hear how you get on.

Deleted nvm now npm is not working

I installed nvm to update my node but then decided to uninstall. After updating my node via website, I am not able to get npm installed despite installing a new version of node and using:
sudo curl -L npmjs.org/install.sh | sudo sh
Here is the message I am getting:
-bash: /Users/SICNARF/.nvm/versions/node/v8.2.1/bin/npm: No such file or directory
I think I just have to change the command from non-existing nvm directory to (wherever its supposed to run).
Node.js version management: no subshells, no profile setup, no convoluted API, just simple.
Installation
npm install -g n
Example
$ n 8.2.1
https://www.npmjs.com/package/n

nodeclipse: command not found on Linux after install it

I have nodejs and npm installed.
I tested npm -v and nodejs -v it worked, showed the current version.
I used the nodeclipse -p command line in my empty folder to create the project structure, but I received the error: command not found
I uninstalled the nodeclipse with npm uninstall and installed again with sudo npm install and did not work.
I used the root account and run the npm install also did not work.
I don´t found the npm or nodejs references to set the environment variable to set the nodeclipse or config it.
Can anyone help please?
Problem
There is a bug in nodeclipse plugin that recognizes Node.js as node command the Windows installation.
In Linux the nodeclipse plugin tries to find the command node and can not find. Why on Linux, the nodejs command is utilized for the Node.js installed.
printing error in the terminal
paranhos#pc-principal:~/workspace-javascript/react-sample$ nodeclipse -p
/usr/bin/env: "node": File or directory not found
Solution: Create a Symbolic Link
sudo ln -s "$ (which nodejs)" /usr/bin/node
or
sudo ln -s /usr/bin/nodejs /usr/bin/node
Successful result
paranhos # pc-main: ~ $ node -v
v4.4.2
paranhos # pc-main: ~ $ nodejs -v
v4.4.2
paranhos # pc-main: ~ $ nodeclipse -h   
Usage: nodeclipse [arguments]   
--help Nodeclipse install > is Nodeclipse CLI Installer Help
I also can solve this question, installing the new nodejs version for my linux distro.
Getting ".deb" package directly and following the instructions in the url´s:
https://nodejs.org/en/download/package-manager/
https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
In the version 4.4.7 or latest was Included node and nodejs as command.
Install with npm install -g nodeclipse
then work nodeclipse command
Hope work fine

npm protocol error after yo hubot command

I've been on this for about a day now. I'm running ubuntu/trusty64 on virtual box via vagrant. Each time i try to scaffold a new hubot project with yo hubot command, hubot gets installed but with npm errors. I really can't figure out what the issue is.
i installed node, npm, hubot and coffee script via the shell. here is what my provision.sh script looks like
#!/bin/bash
# update package libraries
apt-get -y update
# install curl if it is not already installed
apt-get -y install curl
# if nodejs is not installed...
type node >/dev/null 2>&1 || if [[ $? != 0 ]]; then
# we install it
curl -sL http://deb.nodesource.com/setup_5.x | sudo -E bash -
apt-get -y install nodejs
# update npm
npm install -g npm
fi
command -v hubot &>/dev/null || {
npm install -g hubot coffee-script
}
# install yeoman for hubot
command -v yo &>/dev/null || {
npm install -g yo generator-hubot
}
The nodejs version installed is v5.11.1
The npm version installed is v3.8.6
After installation, the next step is to scaffold hubot. This is done by creating a new directory.I named the directory myhubot. When I switch into the directory and type the command: Yo hubot --default, it begins installation but it ends with this error:
13519 error Linux 3.13.0-86-generic
13520 error argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "hubot" "hubot-scripts" "hubot-diagnostics" "hubot-help" "hubot-heroku-keepalive" "hubot-google-images" "hubot-google-translate" "hubot-pugme" "hubot-maps" "hubot-redis-brain" "hubot-rules" "hubot-shipit" "--save"
13521 error node v5.11.1
13522 error npm v3.8.6
13523 error path ../coffee-script/bin/coffee
13524 error code EPROTO
13525 error errno -71
13526 error syscall symlink
13527 error EPROTO: protocol error, symlink '../coffee-script/bin/coffee' -> '/vagrant/myhubot/node_modules/.bin/coffee'
13528 error If you need help, you may report this error at:
13528 error <https://github.com/npm/npm/issues>
13529 verbose exit [ -71, true ]
Apparently, even after the error log, if type the "hubot" command, I'm logged
into the hubot shell. But then, when i ping hubot, I don't get a reply.
Here is the full npm-debug log.
I think this image too will be helpful. Thanks in advance.
The error occurs because the npm command requires symlinks and it is not supported in Windows as referenced in this issue: https://github.com/npm/npm/issues/9901
You can fix this issue by following the steps outlined in this post: Symbolic Links with Vagrant Windows
The steps are:
Add a snippet to your VagrantFile to enable symlinks:
config.vm.provider "virtualbox" do |v|
v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
end
Boot the Vagrant machine in Administrator mode
This is to circumvent Vagrant's restriction on symbolic links.

Can't build atom on Linux

I followed these steps to build atom on Linux on my own.
After cloning atom, i tried to run script/build. But i get an error "No such file or directory".
Node v0.10.31
Npm v0.10.31
I don't now how can I run these atom-build-script.
After searching, i found a solution to fix this issue.
[1] after installing node via apt, its command is nodejs, not node like its recommended to use these build-script
[1.1] after removing apt's node installation, i build node by my own
[2] run which node, to find out where you install node
[3] to run the build-script: /opt/node/bin/node your-atom-path/script/build
additional information how to fix from atom-github-build-instructions
"/usr/bin/env: node: No such file or directory
If you get this notice when attempting to script/build, you either do not have Node.js installed, or node isn't identified as Node.js on your machine. If it's the latter, entering sudo ln -s /usr/bin/nodejs /usr/bin/node into your terminal may fix the issue."

Resources