简体   繁体   中英

How do I solve sh: 1: nx: Permission denied in Linux?

I'm trying to run an Angular application on Linux Virtual Machine using:

npm start

However, it says:

> application@1.28.2-rc-retail.2 start
> nx serve

sh: 1: nx: Permission denied

(that's it, nothing else)

According to this stackoverflow post , I should try:

npm config set user 0
npm config set unsafe-perm true

However, it outputs:

npm ERR! code EUSAGE

Full output:

在此处输入图像描述

There's not much stackoverflow post regarding just "sh: 1: nx: Permission denied". Other people's errors are more descriptive than in my situation.

Why am I getting this error and how do I solve it? I would appreciate your knowledge and experience in this subject, thanks.

I think you might get this under two conditions:

  1. You didn't run the command from the directory where node_modules is installed (maybe one level up)
  2. You don't have nx installed globally - you could try with npx nx serve instead

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM