Questions tagged [npm]
10827 questions
1
votes
2
answer
73
Views
Why do I have to start some scripts with “npm start x” and others with “npm x” only?
In my package.json, I have the following part for script definition.
'scripts': {
'ng': 'ng',
'start': 'ng serve',
'build': 'ng build --prod',
'test': 'ng test',
'lint': 'ng lint',
'e2e': 'ng e2e'
}, ...
Whenever I want to run the app, I go npm start (which executes ng serve). I can also go npm run...
1
votes
1
answer
873
Views
Run npm project cloned from git
I want to run npm project, which was cloned from git, on my computer, but usual command like npm start did not work. Can someone give some tutorial how to start such projects or share some information.
1
votes
3
answer
1.1k
Views
Building Angular project lead to heap out of memory
When trying to build an Angular project on a Linux server with -aot flag, I get an error. I tried upgrading my instance to a higher CPU core, more RAM and turn on a SWAP partition but still the error just occur faster.
Here's while trying to build from terminal along with the command with the flags...
1
votes
2
answer
334
Views
npm sub script with command line parameters
I have some npm scripts that look like this:
'scripts': {
'exec:dev': 'export NODE_ENV=development && npm run exec',
'exec:stage': 'export NODE_ENV=stage && npm run exec',
'exec:prod': 'export NODE_ENV=production && npm run exec',
'exec': 'node myapp.js'
}
I'd like to pass some command line argument...
1
votes
1
answer
332
Views
Rails / Webpack: TinyMCE cannot load skins (404 (Not Found))
I am working on a Rails project that has been using assets pipeline but we are currently trying to transition to webpack. I encountered a problem when attempting to get TinyMCE to work after pulling it through yarn - the text editor simply won't load.
Before the transition to webpack
Originally I us...
1
votes
1
answer
1.7k
Views
npm ERR! missing script: build:universal
I am trying to run my Angular application on the server side and I am facing these errors:
npm ERR! missing script: build:universal
npm ERR! A complete log of this run can be found in: npm ERR!
/home/training/.npm/_logs/2018-10-03T11_50_40_593Z-debug.log
I used the official Angular application for d...
1
votes
1
answer
1.9k
Views
Could not find module “@angular-devkit/build-angular” with ng serve
Studying Angular,
Trying to do those simple steps for generate new projects, but when I am trying to start ng-serve I got those errors:
Could not find module '@angular-devkit/build-angular' from 'C:\\Users\\lingar\\AngularProjects2\\project1'.
Error: Could not find module '@angular-devkit/build-ang...
1
votes
1
answer
2.5k
Views
The serve command requires to be run in an Angular project, but a project definition could not be found in Angular 4
I have cloned one of my old project from github and tried to install node_module and found some vulnerabilities. To fix them I ran the following command
npm audit fix
there were still some more vulnerabilities, so I ran the forced fix command
npm audit fix --force
After that when I am trying to run...
0
votes
0
answer
7
Views
How I fix this problem and install Angular CLI properly?
When I try to install Angular CLI by using this command
npm install -g @angular/cli
Then it shows these messages
C:\Users\MAK\AppData\Roaming\npm\ng -> C:\Users\MAK\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\@an...
1
votes
2
answer
27
Views
npm install -g -D not updating dev dependencies in package.json
I've tried opening and closing the open package.json editor, and restarting VS Code, and running and re-running the npm install command at least 8 times but to no avail.
For some reason, the command below does not update my dev dependencies in my package.json file.
$ npm install -g -D webpack
I know...
1
votes
2
answer
34
Views
Vue.js + Webpack Requesting Multiple Incorrect Resource URLs
I've been using Vue.js single file components to build a website and really enjoying the modular system. I'm running into an issue however where the browser seems to be requesting multiple versions of resources instead of just one URL for each.
HeaderBar.vue
export default {
name: 'HeaderBar'
}
#hea...
1
votes
1
answer
43
Views
npm script is ignoring arguments of grep command
I have handy command for looking for TODO notes in my files. It works fine directly from the command line (ubuntu).
This is the plain CLI command:
grep -lir --color --exclude-dir={node_modules,libs} --exclude=package.json 'todo'
And this its occurrence in package.json
{
'private': true,
…
'scripts...
1
votes
2
answer
41
Views
TypeError: Cannot read property 'any' of undefined after update
I updated several npm packages in my application and encountered a bunch of errors that I had already safely solved except for one!
TypeError: Cannot read property 'any' of undefined
at Object. (/home/cpt/Desktop/prod/local/app/components/Base/react-quick-return.js:11:24)
at loader (/home/cpt/Deskto...
1
votes
1
answer
33
Views
Cannot start Electron application - missing package.json
I'm currently doing a Python project where I want to display my results in an Electron application. I have seen a demo video on YouTube on how to set up Electron on a Mac. The video showed 3 simple steps to be executed in the terminal:
git clone https://github.com/electron/electron-quick-start
cd el...
1
votes
1
answer
86
Views
Npm can't install node-sass
When i install npm on my project angular.
There is an failed install of node-sass.
And after it's impossible to run ng serve.
npm ERR! [email protected] postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is pro...
0
votes
0
answer
5
Views
Need help understanding how to package React component library with Webpack
I'm trying to create a library of generic React Components that I use a lot. I have managed to get the library working and can npm install it ok. It also compiles correctly when I import the Components with something like from another project:
import { Title } from '@orderandchaos/react-components/d...
0
votes
0
answer
11
Views
Unhandled error in npm-cache in core-js npm package
I am trying to execute npm install. I deleted node_modules and then I entered npm i command. I am getting below error. Why I am getting below errors ? However once I was able to build it success, after deleting the node_module and installed latest version of node I am getting below error.
npm WARN d...
0
votes
0
answer
4
Views
Navbar component not displaying react-bootstrap CSS
I am rendering a react-bootstrap navbar but I am just getting jumbled text with none of the bootstrap styles.
I have the bootstrap CDN tag. I have installed react-bootstrap to the project with npm. I also made sure not to use the Bootstrap 4 tag, as home have said that doesn't work with react-bootst...
0
votes
0
answer
2
Views
NPM-link side project to monorepo's packages
I'm trying to use a js monorepo of another Github user in a project sitting in the same root folder.
/project/editor-monorepo
/project/my-project
I tried using
cd /project/my-project
npm-link ../editor-monorepo/packages/package1...
While it produced no errors in the console, my-project now fails wit...
-1
votes
0
answer
24
Views
How to use _lodash within nodejs api service
I'm trying to use the _lodash.groupBy service within a nodejs api service. I built my api following this tutorial: nodejs-mongodb-api. I then made my own API for rosters. I am trying to use _lodash to group some data before I send it back to the front end, but I'm getting an UnhandledPromiseRejectio...
1
votes
1
answer
1k
Views
Installing npm canvas on elasticbeanstalk - npm install error
I am trying to deploy a node.js server running on EC2 via Elasticbeanstalk.
The problem I am having is during the rebuild of the canvas npm module.
The command '[email protected] install: node-gyp rebuild' fails as follows:
> [email protected] install /tmp/deployment/application/node_modules/canvas
> node-gyp...
1
votes
1
answer
426
Views
NPM Packages (with CLI) installed globally return command not found
I've had this happen twice to me before. The first time I assumed it was an error with NPM, so I uninstalled Node & NPM and didn't use the package that was giving me an error.
I did a fresh install & began working on another project. I'd installed the package (and the version of it with cli). The c...
0
votes
1
answer
26
Views
“How to fix “ Error: Cannot find module ”@angular/core/src/view/util”
I am building an ionic project for my final year project, and suddenly my laptop got a short circuit. So right now I'm developing back my project through multiple computers/laptop, but my project seems cannot shows it output. Every time I did ionic serve, it is throwing an error saying Runtime Error...
1
votes
3
answer
2.3k
Views
unable to resolve module `@expo/vector-icons`
Im not sure why I'm getting this error:
Unable to resolve module `@expo/vector-icons` from `...(directory path here)...` : Module does not exist in the module pack
I have tried the following things suggested on other forums/sites:
Clear watchman watches
Deleting the node_modules folder
Reset package...
1
votes
1
answer
1.9k
Views
Error: Cannot find module './util/resolveCommand'
I'm not able to npm start anymore due to a problem with the util npm I think.
I tried to update all the packages and to remove util and re-install it. How could I solve this?
Error: Cannot find module './util/resolveCommand'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module....
1
votes
3
answer
459
Views
Importing Ant Design Component doesn't work
I'm shocked over this problem I'm currently having right now. All my logic literally stopped. Something started not working, without me having changed anything. I mean I even have it on production, the identical code, but locally it started not working, out of nothing. Even when I go back to previou...
1
votes
1
answer
354
Views
NPM Getting Aborted Error in nodejs
I am new in nodejs i have installed nodejs successfully, when i init the npm i am getting aborted error.
I have a lot of memory means 32GB RAM and 1TB HD.
Only npm -v command working rest all command not working with npm.
Please see the below error and help me.
[[email protected] node]$ npm init
[13396:0x...
1
votes
4
answer
1.4k
Views
Can't install node-sass
I am attempting to install node-sass and it just won't let me. I have tried updating npm.
I put this in:
sudo npm install -g node-sass
and i get this (starting one line before the error):
gyp verb build dir attempting to create 'build' dir:
/Users/matt/node_modules/node-sass/build
gyp ERR! confi...
1
votes
2
answer
2.7k
Views
NPM install permission denied error using root user
So I've made a fresh installation of npm/node on my local machine using NVM using root user and everything looks fine, now my issue is when I tried to install using npm install --unsafe-perm -verbose command on my project folder error displays in my terminal.
npm verb stack Error: Command failed: /u...
1
votes
2
answer
1k
Views
Dockerfile: add npm to an existing docker image
Having a Jenkins Docker image, I would like to add the complete 'npm' environment to that image. So after building the Dockerfile I have an image with both Jenkins and the 'npm' environment.
The purpose is that a Jenkins job to run the shell command 'npm'. So 'npm' should be on the $PATH (in Ubuntu...
1
votes
1
answer
558
Views
Install npm sqlite3 on Windows for Electron App
I have a problem installing sqlite3 with npm in windows for an electron app.
I installed sqlite3 with npm:
npm i sqlite3
Then I executed:
.\node_modules\.bin\electron-rebuild.cmd
And I have this error:
× Rebuild Failed
An unhandled error occurred inside electron-rebuild
gyp info it worked if it end...
1
votes
1
answer
78
Views
Installing es6-promise
I am working through the nodeschool.io workshops and the second exercise of promise-it-wont-hurt is instructing me to install es6-promise.
Using my Windows 7 command prompt, I am typing npm install es6-promise (and some other variations) and I am getting the message.
npm ERR! code E404
npm ERR! 404...
1
votes
2
answer
137
Views
Can't run ng serve within Angular project
So I am trying to serve or build my Angular application. I have always found it difficult to use the angular CLI commands. Every time I run ng serve or npm run ng serve.
I get the error 'The serve command requires to be run in an Angular project, but a project definition could not be found.'
I don...
1
votes
3
answer
45
Views
Private NPM library raise error “Module parse failed”
I'm trying to create my libary with React and to use it locally (with my company git repository).
I can test my app while developping with npm run start. My app is running.
But when I want to use it in an other project, I got this error :
ERROR in ./node_modules/mylib/src/views/calendar.jsx
Module p...
1
votes
2
answer
256
Views
How to downgrade angular7 to angular6
I have tried to downgrade angular 7 to angular 6 by running the following npm commands:
npm uninstall -g angular-cli
npm cache clean
npm install -g [email protected]
However angular/cli 7 version is still displaying in my package.json file. I need help to downgrade angular7 to angular6.
1
votes
1
answer
46
Views
npm won't start:dev on NestJS application
So I created a new NestJS application with the CLI. I got nodemon installed as a dependency and globally. My package.json looks like this:
'scripts': {
'build': 'tsc -p tsconfig.build.json',
'format': 'prettier --write \'src/**/*.ts\'',
'start': 'ts-node -r tsconfig-paths/register src/main.ts',
'sta...
1
votes
2
answer
30
Views
Moment.js Plugins should I install both dependencies?
I want to use a moment.js plugin like moment-business-days.
Should I install both dependencies?
npm install moment-business-days
npm install moment // yes / no / maybe?
Or is it enough to install the plugin as it comes with the moment.js dependency itself?
Is there a best practice?
3
votes
2
answer
192
Views
npm install fails due to private git repository both ssh and https connections
I have the following package.json file and I am trying to run npm install, but it fails.
'test': 'git+https://@github.build.test.com/test.git',
I have ssh key matched to github. However even I write the following, it always run with https.
'test': 'git+ssh://[email protected]/test.git',
In b...
0
votes
0
answer
4
Views
I cannot set style of worksheet of xlsx document in angular
Whereas I can change the value of cells exc., I cannot set style of cells in typescript. When i try to change it, in excel there is no change. I read documents about it but i cannot find solution.
My code is like this:
var worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json);
var cell = { s:...
1
votes
0
answer
150
Views
How to prevent npm install from installing my dependency's devDependencies?
I was using Node 9.3.0 and npm 5.6.0
I developed a library (let's call it Foo) which was hosted on GitHub. In its package.json, it has several devDependencies, but doesn't have any dependencies.
Then I created a new project called Bar and run npm install my-github/Foo. Instead of the single package...