【问题标题】:I am facing problem in running my first ionic project我在运行我的第一个离子项目时遇到问题
【发布时间】:2018-09-21 16:21:23
【问题描述】:

我用的是mac

我尝试运行我的第一个 ionic 项目,但在我的 mac 中运行它时遇到错误

我正在将我遵循的所有步骤放入终端 -

  1. 开始于 - : $ ionic start MyIonicProject 教程
  2. $cd MyIonicProject
  3. $ionic 服务

然后我收到错误

Error: EACCES: permission denied, open '/Users/user/.ionic/helper.log'
> ionic-app-scripts serve --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser

[INFO] Looks like @ionic/app-scripts isn't installed in this project.

       This package is required for this command to work properly.

? Install @ionic/app-scripts? Yes
> npm i -D -E @ionic/app-scripts
npm WARN deprecated hoek@2.16.3: The major version is no longer supported. Please update to 4.x or newer
npm WARN checkPermissions Missing write access to /Users/user/Projects/MyIonicProject/node_modules
npm WARN checkPermissions Missing write access to /Users/user/Projects/MyIonicProject/node_modules/@ionic
npm ERR! path /Users/user/Projects/MyIonicProject/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/Users/user/Projects/MyIonicProject/node_modules'
npm ERR!  { Error: EACCES: permission denied, access '/Users/user/Projects/MyIonicProject/node_modules'
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/Users/user/Projects/MyIonicProject/node_modules\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/Users/user/Projects/MyIonicProject/node_modules' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/user/.npm/_logs/2018-09-21T06_24_56_379Z-debug.log
users-MacBook-Pro-3:MyIonicProject user$ 

【问题讨论】:

  • 尝试使用“npm install”安装节点依赖项
  • 我已经在应用程序中有 node_module 文件夹,你的这个解决方案对我没有帮助

标签: ionic-framework ionic3


【解决方案1】:

尝试通过附加sudo 来运行命令,如下所示:

sudo ionic serve

或者

在终端窗口中运行以下命令:

sudo chown -R $USER /usr/local/

这将更改本地文件夹中所有内容的权限,然后尝试以下命令:

sudo ionic serve

【讨论】:

    【解决方案2】:

    这个项目中似乎没有安装@ionic/app-scripts。

    所以先试试这个:

    npm install @ionic/app-scripts@latest --save-dev
    

    然后:

    npm install 
    

    ionic serve -l
    

    【讨论】:

      猜你喜欢
      • 2021-02-15
      • 2022-01-01
      • 2021-12-17
      • 2022-06-11
      • 2021-08-09
      • 2022-06-10
      • 1970-01-01
      • 1970-01-01
      • 2020-11-08
      相关资源
      最近更新 更多