how to extend PATH in zc.recipe.cmmi - buildout

Installing NPM using zc.buildout I need to extend the PATH environment variable:
[npm]
recipe=zc.recipe.cmmi
url=https://github.com/isaacs/npm/tarball/v1.1.1
environment = PATH=$PATH:${nodejs:location}/bin
[nodejs]
recipe=zc.recipe.cmmi
url=http://nodejs.org/dist/node-latest.tar.gz
#prefix option is added by default
But it doesn't work:
Installing npm.
npm: Unpacking and configuring
npm: Updating environment: PATH=$PATH:/Users/toutpt/makina/rempeitec/cubes/parts/nodejs/bin
./configure: line 11: dirname: command not found
sh: make: command not found
npm: cmmi failed: /var/folders/n0/srl4c2h500zfvcny_r55t41h0000gr/T/tmpKpXrcPbuildout-npm
While:
Installing npm.
If I set the path myself it works but it's not repetable. I have tried $$PATH, \$PATH without success.

I think this should work, but in any case it's much more convenient to install node.js packages by using gp.recipe.node

You can use minitage.recipe.cmmi, which will support to add something to $PATH.
[npm]
recipe=minitage.recipe.cmmi
url=https://github.com/isaacs/npm/tarball/v1.1.1
path=${nodejs:location}/bin

Related

Not able to install Yarn through corepack

Environment: Windows, Node 16.18.0, Corepack 0.14.1
I am following these instructions to install Yarn.
When I run corepack prepare yarn#3.2.4 or corepack prepare yarn#3.2.4 --activate
I get the following error:
Preparing yarn#3.2.4... Internal Error: ENOENT: no such file or directory, stat 'C:\Users\rashiditaba\AppData\Local\node\corepack\yarn\3.2.4' Error: ENOENT: no such file or directory, stat 'C:\Users\***\AppData\Local\node\corepack\yarn\3.2.4'
Hello I experienced the same problem. Corepack is an experimental tool to help with managing versions of your package managers. Due to its experimental status, Corepack currently needs to be explicitly enabled to have any effect.
Disable Corepack with the command:
corepack disable
You will now be able to install yarn via npm:
npm install -g yarn --force
To check the installed version of yarn use:
yarn -v
To upgrade the version use (stable version 3.2.4):
yarn set version stable
Now you can enable corepack again (if it fails keep it disabled):
corepack enable
Try the failed command:
corepack prepare yarn#3.2.4 --activate
I leave you the link with the description of the solution:
https://nodejs.org/dist/latest/docs/api/corepack.html
I hope it helps you
From the error your getting it seems like you have to wrong directory PATH to yarn. Find the directory where yarn is installed and update it's PATH in the environment variables.

How to fix 'command not found' for aws-cdk after running the npm install

I am trying to install the aws-cdk and in the terminal and I run the npm install -g aws-cdk. As stated here After npm runs, I get:
/usr/local/Cellar/node/9.8.0/bin/cdk -> /usr/local/Cellar/node/9.8.0/lib/node_modules/aws-cdk/bin/cdk
+ aws-cdk#0.31.0
updated 1 package in 1.636s
If I try to run cdk I get:
zsh: command not found: cdk
Installing as root worked for me:
sudo npm install -g aws-cdk
Make sure /usr/local/Cellar/node/9.8.0/bin is in your PATH
In my case, I added this to the end of my .bash_profile:
export PATH=$PATH:$(npm get prefix)/bin.
I did that based on information from a different thread.
If you're using nvm to manage your node versions, make sure that the CDK package is being installed in the same version of node you're currently using or the version you want to use.
The OP noted their CDK was getting installed in node/9.8.0:
Check the current node version running: nvm current.
If you see that the CDK installation location is different than the node version indicated by nvm current, you'll need to switch your node version using:
nvm use <node-version-where-cdk-is-installed>
In the OP's case, this would be nvm use 9.8.0.
What worked for me in mac was adding to the path the bin directory of globally installed node modules.
Install aws-cdk by:
npm install -g aws-cdk
Try to run it
cdk
no command found error
make or edit your .zshrc file in your user directory
add line to .zshrc with export PATH=$PATH:/{your_user_path}/.npm-global/bin
execute it source .zshrc
now cdk should work
Pay attention that it is mac based approach.

Cannot get "npm install #feathers/cli -g" to work in the command line

I get this error message when I try installing feathers from npm
npm WARN deprecated nomnom#1.8.1: Package no longer supported. Contact support#npmjs.com for more info.
npm WARN deprecated babel-preset-es2015#6.24.1: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
Help!!
As Vasan pointed out in the comments, running
npm install -g #feathersjs/cli
from the command prompt on Windows installs a file feathers.cmd in the folder:
%APPDATA%\npm
If this folder is not on your PATH, then feathers will not be recognised as an executable - it appears that the global install doesn't add it to the path automatically.
Editing system environment variables to add this folder to your path should make the feathers cli tools available.
Note that after altering your path you may need to restart your terminal for the updated path to be available.
Its very simple, if you have an earlier version installed, uninstall the old feathers-cli using:
npm uninstall feathers-cli -g
Then install #feathersjs/cli and upgrade a project by the following commands:
npm install #feathersjs/cli -g
cd path/to/project
feathers upgrade
I also faced with the installation issue. But got an error: 404 Not Found: babel-messages#^6.23.0. I've solved it when run npm install #feathersjs/cli -g through the windows terminal (cmd). Before that I was running it on bash.
This issue also occurs when installation is ran using Admin credential(Windows 10), reinstall without elevated cmd/powershell credential also solved the problem.

create-react-app using npx generating error message path not found

After running following command i am getting error
npx create-react-app
"$basedir/../../Users/abc/AppData/Local/Yarn/.global/node_modules/.bin/create-react-app.cmd" "$#"
The system cannot find the path specified.
node and NPM versions
λ node -v
v9.5.0
λ npm -v
5.6.0
After searching and some digging, I finally found the solution. I installed yarn before, so it was mixing something up...
create-react-app command was still working when i completely removed it form my PC.
In short create-react-app.cmd file was reside in ProgramFils\nodjs folder I don't know why/how this file was there. After removing the creat-react-app command file all was set.
I had the same error message. I solved this by using yarn instead of npx:
yarn create react-app [name of app]
Note there is no hyphen between create and react-app

Installing specific node version using NVM gives an error

I want to install node v6.10.3. but when I tried to install it gives the following error. What causes this error?
creating .\config.gypi
creating .\config.mk
bash: make: command not found
nvm: install v6.10.3 failed!
(nvm maintainer here) Could you file this on http://nvm.sh, and fill out the issue template? This kind of question is more appropriate for the repo than for SO.