In my project, I'm using Angular6 for the frontend. Now what I'm trying to lớn tự is deploy my project which is in remote server into the actual server. I'm using npm lập cập build -prod command to lớn build the frontend first. But I can't build my project since the following error occurs again and again,

npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! [email protected] build: `ng build --prod --build-optimizer --aot`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this lập cập can be found in:
npm ERR!     C:\Users\Indrajith.E\AppData\Roaming\npm-cache\_logs\2019-08-22T08_41_00_271Z-debug.log

My error log in the C:\Users\Indrajith.E\AppData\Roaming\npm-cache\_logs\2019-08-22T08_41_00_271Z-debug.log tệp tin path contains the same error details mentioned above.

How can I resolve this problem?

Omair Nabiel

1,6722 gold badges13 silver badges26 bronze badges

asked Aug 22, 2019 at 8:47

Delete your package-lock.json tệp tin and node_modules thư mục. Then tự npm cache clean

npm cache clean --force

do npm install

again and run

answered Aug 22, 2019 at 8:56

1

Finally, I found a solution to lớn this problem without reinstalling npm and I'm posting it because in future it will help someone, Most of the time this error occurs javascript heap went out of the memory. As the error says itself this is not a problem with npm. Only we have to lớn tự is

instead of,

npm  lập cập build -prod

extend the javascript memory by following,

node --max_old_space_size=4096 node_modules/@angular/cli/bin/ng build --prod

answered Aug 22, 2019 at 9:19

4

Please delete package-lock.json and clear npm cache with npm cache clear --force and delete whole node_modules directory

Finally install or update packages again with npm install / npm update You can also add any new packages with npm install

This fixed for u.

Thanks and happy coding.

answered Jul 5, 2020 at 18:19

2

I'm on Ubuntu 18.04. I fixed this problem by increasing the inotify max_user_watches using this command:

echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches

answered Jan 14, 2020 at 15:33

I'm new with react... Well i had the same output:

Starting the development server...

events.js:196
      throw er; // Unhandled 'error' event
      ^

Error: ENOSPC: System limit for number of tệp tin watchers reached, watch '/opt/lampp/htdocs/react-tuto/public'
    at FSWatcher. (internal/fs/watchers.js:168:26)
    at Object.watch (fs.js:1351:34)
    at createFsWatchInstance (/opt/lampp/htdocs/react-tuto/node_modules/chokidar/lib/nodefs-handler.js:38:15)
    at setFsWatchListener (/opt/lampp/htdocs/react-tuto/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/opt/lampp/htdocs/react-tuto/node_modules/chokidar/lib/nodefs-handler.js:233:14)
    at FSWatcher.NodeFsHandler._handleDir (/opt/lampp/htdocs/react-tuto/node_modules/chokidar/lib/nodefs-handler.js:429:19)
    at FSWatcher. (/opt/lampp/htdocs/react-tuto/node_modules/chokidar/lib/nodefs-handler.js:477:19)
    at FSWatcher. (/opt/lampp/htdocs/react-tuto/node_modules/chokidar/lib/nodefs-handler.js:482:16)
    at FSReqCallback.oncomplete (fs.js:165:5)
Emitted 'error' sự kiện on FSWatcher instance at:
    at FSWatcher._handleError (/opt/lampp/htdocs/react-tuto/node_modules/chokidar/index.js:260:10)
    at createFsWatchInstance (/opt/lampp/htdocs/react-tuto/node_modules/chokidar/lib/nodefs-handler.js:40:5)
    at setFsWatchListener (/opt/lampp/htdocs/react-tuto/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    [... lines matching original stack trace ...]
    at FSReqCallback.oncomplete (fs.js:165:5) {
  errno: -28,
  syscall: 'watch',
  code: 'ENOSPC',
  path: '/opt/lampp/htdocs/react-tuto/public',
  filename: '/opt/lampp/htdocs/react-tuto/public'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `react-scripts start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this lập cập can be found in:
npm ERR!     /home/paulo/.npm/_logs/2019-12-16T16_46_27_856Z-debug.log

I just tried:

sudo npm start

And it worked.

answered Dec 16, 2019 at 16:47

I already have the same problem . and I fix it using npm updatenpm cache clean --force

answered Apr 12, 2020 at 22:42

1

Delete node_modules

rm -r node_modules

install packages again

npm install

answered Sep 7, 2020 at 7:55

2

Delete node_module directory and lập cập below in command line

rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install

If still not working, try below

npm install webpack --save

answered Feb 19, 2021 at 15:26

For the people it didn't work, I spent two days finding the solution and there was just one command that worked lượt thích a magic.

npm install -g live-server

and then run: npm start

it will start as normal.You can read all the details here https://www.npmjs.com/package/live-server

answered Jul 1, 2021 at 11:41

For u, the problem was in firebase.json, the site name was incorrect.

answered Nov 21, 2020 at 4:06

I had encountered the same error. And, I just simply deleted the whole node_modules thư mục, and installed the npm packages again solved my error.

  1. Delete node_modules (don't worry you have package.json)

  2. npm install

answered May 26, 2022 at 4:05

Deleting the package-lock.json did it for u. I'd suggest you not push package-lock.json to lớn your repo as I wasted hours trying to lớn npm install with the package-lock.json in the thư mục which gave u helluva errors.

answered Nov 25, 2019 at 5:42

1

Check if port you want to lớn lập cập your phầm mềm is không lấy phí. For u, it was the problem.

answered Dec 26, 2019 at 13:15

Following steps solves my problem: Add "C:\Windows\System32\" to lớn your system path variables Run npm eject, Run npm start, Run npm eject, and agian run npm start And it worked😊

answered Mar 19, 2020 at 11:47

For u, I was trying to lớn install an old version of bcrypt which was not found in npm, I just edited package.json and manually put the latest version and then ran npm install and it worked

answered May 12, 2020 at 23:46

  1. first delete the tệp tin (project).
  2. then rm -rf \Users\Indrajith.E\AppData\Roaming\npm-cache_logs\2019-08-22T08_41_00_271Z-debug.log (this is the file(log) which is showing error).
  3. recreate your project for example :- npx create-react-app hello_world
  4. then cd hello_world.
  5. then npm start.

I was also having this same error but hopefully after spending 1 day on this error i have got this solution and it got started perfectly and i also hope this works for you guys also...

answered Aug 31, 2020 at 14:55

Novice mistake. Make sure your package.json tệp tin is coded correctly. I had:

"start": "index node.js"
instead of:
"start": "node index.js"

17

Delete your package-lock.json tệp tin and node_modules thư mục. Then tự npm cache clean

npm cache clean --force do npm install

answered Jun 5, 2020 at 1:56

I just tự two steps: first:

export METEOR_ALLOW_SUPERUSER=true;

second:

sudo systemctl stop bbb-html5

and finally:

npm start

answered Apr 15, 2021 at 4:19

My project is on wagtail. I solved this problem by running the following command:npm update và npm cache clean --force

answered Sep 5, 2021 at 0:40

I had the issue in React. In my case it was happening, because I didn't see warnings/errors above the message. After fixing the issues, everything worked properly. Hopefully it's going to lớn help someone.

user776686

8,61517 gold badges78 silver badges137 bronze badges

answered Dec 10, 2021 at 21:05

On Ubuntu, I restarted the server and the problem was solved.

answered Jan 7, 2022 at 18:49

For u, it happens because of the low version of Node. Upload my Node version and it worked successfully.

answered Jun 13, 2022 at 15:39

1