Heroku not installing certain Node modules - javascript

I'm trying deploy a Lerna app on Heroku, but the platform isn't installing the actual Lerna package in the node_modules no matter what I do. I've gotten to the point where I have accessed the app files directly and tried running npm install lerna#6.0.0 on the server itself. The result is that it installs a number of packages and says that it has added Lerna as well, but actually hasn't.
~ $ npm install lerna#6.0.0
npm WARN deprecated #npmcli/move-file#2.0.1: This functionality has been moved to #npmcli/fs
npm WARN nx#15.6.2 requires a peer of #swc-node/register#^1.4.2 but none is installed. You must install peer dependencies yourself.
npm WARN nx#15.6.2 requires a peer of #swc/core#^1.2.173 but none is installed. You must install peer dependencies yourself.
npm WARN project#1.0.0 No description
npm WARN project#1.0.0 No repository field.
+ lerna#6.0.0
added 16 packages from 7 contributors and audited 1081 packages in 26.529s
found 12 vulnerabilities (2 low, 2 moderate, 6 high, 2 critical)
run `npm audit fix` to fix them, or `npm audit` for details
~ $ cd node_modules/
~/node_modules $ ls
#pnpm cross-spawn get-stream human-signals is-stream isexe merge-stream mimic-fn npm-run-path onetime path-key shebang-command shebang-regex signal-exit strip-final-newline which
~/node_modules $ cd lerna
bash: cd: lerna: No such file or directory`
What could I be missing?

For some reason, the dev dependencies on my app were not installing. Even going into the server and manually running npm install for a given package did nothing if it was listed as a devDependency in the package.json. When I moved all dev dependencies to the runtime dependency list, my issue went away and everything was building as before.

Related

How can i install npm moduls on atom?

I want to install the bcrypt package and im using the "npm install bcrypt --python=python2" and i can this after i run it:
bcrypt#5.0.0 install C:\Users\User\node_modules\bcrypt
node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using needle for node-pre-gyp https download
[bcrypt] Success: "C:\Users\User\node_modules\bcrypt\lib\binding\napi-v3\bcrypt_lib.node" is installed via remote
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\User\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\User\package.json'
npm WARN User No description
npm WARN User No repository field.
npm WARN User No README data
npm WARN User No license field.
+ bcrypt#5.0.0
updated 1 package and audited 130 packages in 2.951s
1 package is looking for funding
run `npm fund` for details
found 0 vulnerabilities
I don't get any module in atom.
This is an error that tells you that current folder you are working in does not have a node project set up, its missing the necessary package.json file (every node project has one and needs one).
There are 2 types of "install" with npm, first is global that that you mark with -g flag (npm install bcrypt -g), this will install whatever package into global node modules that can be executed from the node command line, the second one is installing / adding it to your project.
In order to add anything to your project you need to create your project, create a folder for your project, open cmd line and navigate to the folder, and run npm init, this will create a package.json file (after you answer few questions), then npm install whatever will add the package automatically to the package.json file. (there is also a --save-dev flag that adds node module to dev dependencies)

spuertest installation issue with npm express

i am trying to install supertest but in the terminal i get error, when i run supertest -v says command not found. after installing i get below error. any suggestion would be highly appreciated
i tried to install the dependency with using below methods
npm i/install supertest
2, npm i/install --save-dev spuertest
3, npm i/install --save supertest
#MacBook-Pro Node_Cat_Supertest % npm install --save supertest
npm WARN cat_supertest#1.0.0 No description
npm WARN cat_supertest#1.0.0 No repository field.
supertest#6.0.1
updated 1 package and audited 137 packages in 1.355s
37 packages are looking for funding
run npm fund for details
found 0 vulnerabilities
ahmadimranpopal#MacBook-Pro Node_Cat_Supertest %
Regards
IP
have you ever tried it as a root privileges? and got same results? sudo -i
have you ever tried installing as a global package? npm install <module-name> -g
have you ever tried to installing specific version of the package? npm install <module-name>#<version-name>

how to npm install only devDependencies with node 8.7.x?

The usual way of installing only devDependencies was to use npm install --only=dev (or --only=production if you want only dependencies).
This doesn't work anymore in 8.7. If I run this command, npm will try installing all dependencies. Or at least, it runs a /usr/bin/git ls-remote -h -t on packages that are not in devDependencies. Those packages being in private git repos, the npm install fails for me.
This didn't happen until I upgraded to 8.7.0, from 7.4.0
The npm cli documentation still shows the old way of doing it though.
Is there a new syntax for that option?
From the output of npm help install:
npm install (in package directory, no arguments):
Install the dependencies in the local node_modules folder.
In global mode (ie, with -g or --global appended to the command), it installs the current package context (ie, the current working directory) as a global package.
By default, npm install will install all modules listed as dependencies in npm help 5 package.json.
With the --production flag (or when the NODE_ENV environment variable is set to production), npm will not install modules listed in devDependencies.
So it seems you can install only dependencies with --production; not sure if there's a way to only install devDependencies.

npm install couldnt install angularjs libraries

I have installed mean.io and ran sudo npm install. Actually following commands in sequence
sudo npm install -g meanio
mean init yourNewApp
cd yourNewApp
sudo npm install -g bower
sudo npm install
It is supposed to download and install angularjs libraries into public/system/lib. After doing the above steps public /system/lib is not created due to which when I start the application I get the error
events.js:72
throw er; // Unhandled 'error' event
^
Error: ENOENT, open '/home/santhosh/dev/scaleqa/mean_tut/old mean/temp/myapp/public/system/lib/bootstrap/dist/css/bootstrap.css'
[nodemon] app crashed - waiting for file changes before starting...
Is it something to do with certain npm/angularjs server being down. I have faced this problem earlier also but got fixed on 2nd try and I didn't bother to do more research. This became a big issue when I try to pull my repo into cloud and start the application. public/system/lib is added in .gitignore by default and is expected to be created during npm install.
I get following warnings with sudo npm install
npm WARN package.json mean-connect-mongo#0.4.3 No repository field.
npm WARN cannot run in wd mean#0.3.3 node node_modules/bower/bin/bower install (wd=/home/santhosh/dev/scaleqa/mean_tut/old mean/temp/myapp)
this is link to package.json
The problem maybe related to running npm install as sudo, which can cause problems. As mentioned in another stack overflow question, this can be worked around in a couple ways. But because it looks like this is being run from your home directory, you really shouldn't need to run npm install as root.
Try to issue the same commands, but the last without sudo:
sudo npm install -g meanio
mean init yourNewApp
cd yourNewApp
sudo npm install -g bower
npm install
Note that the reason you may need to run npm install -g <package> using sudo is because by default npm uses /usr/local for global installs, which can be a restricted directory. However, when you install a package locally (without the -g flag) you should not need to run as root.

How do I build backbone boilerplate with grunt?

I'm trying to build the backbone boilerplate project found here: https://github.com/backbone-boilerplate/backbone-boilerplate
I'm having some issues getting it to build properly. Here are the steps I've done which are the steps on the backbone-boilerplate wiki:
git clone https://github.com/backbone-boilerplate/backbone-boilerplate.git
cd backbone-boilerplate
sudo npm install -gq bower
sudo npm install -q
sudo npm install -gq grunt-cli
sudo grunt
At this point I get:
>> Local Npm module "grunt-cli" not found. Is it installed?
Warning: Task "requirejs" not found. Use --force to continue.
Aborted due to warnings.
Any ideas how to get this to build properly?
Specifying depth seems to work:
$ git clone --depth 1 https://github.com/backbone-boilerplate/backbone-boilerplate.git
$ npm install
$ grunt
Also you may want to restart your terminal if that is your first time installing grunt-cli
You're running grunt under elevated privileges. Our documentation for building here:
https://github.com/backbone-boilerplate/backbone-boilerplate#build-process
... has you run that command under your own user. Give that a shot!
You need to ensure you build dependencies with bower, not just the node dependencies.
Getting Started
# Using Git, fetch only the latest commits. You won't need the full history
# for your project.
git clone --depth 1 https://github.com/backbone-boilerplate/backbone-boilerplate
# Move the repository to your own project name.
mv backbone-boilerplate my-project
Updating Dependencies
# Install global dependencies. Depending on your user account you may need to
# gain elevated privileges using something like `sudo`.
npm install -g grunt-cli bower
# Optionally install coveralls (integration is baked in with Travis CI).
npm install -g coveralls
# Install NPM dependencies.
npm install
# Install Bower dependencies. ** THIS IS THE ONE YOU'VE MISSED **
bower install
Build Process
# To run the build process, run the default Grunt task.
grunt
# Run a build and test the now optimized assets.
grunt default server:release
If you have node installed correctly this should work like a charm.

Categories

Resources