Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
NativeScript';创建';EACCES:macOS上的权限被拒绝_Macos_Npm_Nativescript_Sudo_Nativescript Cli - Fatal编程技术网

NativeScript';创建';EACCES:macOS上的权限被拒绝

NativeScript';创建';EACCES:macOS上的权限被拒绝,macos,npm,nativescript,sudo,nativescript-cli,Macos,Npm,Nativescript,Sudo,Nativescript Cli,我对Mac、macOS开发和NativeScript都是新手 我正在尝试使用以下工具启动一个新的tns项目: sudo tns create rsrpt --ng 我一直都会遇到这样的错误: Error: EACCES: permission denied, mkdir '/Users/myUser/code/rsrpt/hooks' 出于沮丧,10小时后,我运行了以下命令: sudo chown -R $(whoami) ~/.local 甚至这样:(我希望我没有破坏这个mac的权限)

我对Mac、macOS开发和NativeScript都是新手

我正在尝试使用以下工具启动一个新的tns项目:

sudo tns create rsrpt --ng
我一直都会遇到这样的错误:

Error: EACCES: permission denied, mkdir '/Users/myUser/code/rsrpt/hooks'
出于沮丧,10小时后,我运行了以下命令:

sudo chown -R $(whoami) ~/.local
甚至这样:(我希望我没有破坏这个mac的权限)

但没有任何帮助。我仍然得到附加的详细错误。任何关于如何克服此许可问题的帮助都将不胜感激!谢谢

> nativescript-angular@6.1.0 postinstall /Users/myUser/code/rsrpt/node_modules/nativescript-angular
> node postinstall.js

fs.js:885
  return binding.mkdir(pathModule._makeLong(path),
                 ^

Error: EACCES: permission denied, mkdir '/Users/myUser/code/rsrpt/hooks'
    at Object.fs.mkdirSync (fs.js:885:18)
    at Object.<anonymous> (/Users/myUser/code/rsrpt/node_modules/nativescript-angular/postinstall.js:11:12)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nativescript-angular@6.1.0 postinstall: `node postinstall.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the nativescript-angular@6.1.0 postinstall 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 run can be found in:
npm ERR!     /Users/myUser/.npm/_logs/2018-08-14T00_22_47_432Z-debug.log
Command npm install failed with exit code 1
# tns create

┌───────────────┬────────────────────────────────────────────────────────────┐
│ Usage         │ Synopsis                                                   │
│ Create from   │ $ tns create <App Name> [--path <Directory>] [--appid <App │
│ default       │ ID>]                                                       │
│ JavaScript    │                                                            │
│ template      │                                                            │
│ Create from   │ $ tns create <App Name> --template typescript [--path      │
│ default       │ <Directory>] [--appid <App ID>] OR $ tns create <App Name> │
│ TypeScript    │ --tsc [--path <Directory>] [--appid <App ID>] OR $         │
│ template      │ tns create <App Name> --template tsc [--path <Directory>]  │
│               │ [--appid <App ID>]                                         │
│ Create from   │ $ tns create <App Name> --template angular [--path         │
│ default       │ <Directory>] [--appid <App ID>] OR $ tns create <App Name> │
│ Angular       │ --template ng [--path <Directory>] [--appid <App ID>]      │
│ template      │ OR $ tns create <App Name> --ng [--path <Directory>] [-    │
│               │ -appid <App ID>]                                           │
│ Copy from     │ $ tns create <App Name> [--path <Directory>] [--appid <App │
│ existing      │ ID>]                                                       │
│ project       │                                                            │
│ Create from   │ $ tns create <App Name> [--path <Directory>] [--appid <App │
│ custom        │ ID>] --template <Template>                                 │
│ template      │                                                            │
└───────────────┴────────────────────────────────────────────────────────────┘

Creates a new project for native development with NativeScript.

### Options

    * --path - Specifies the directory where you want to create the project, if different from the current directory. The directory must be empty.
    * --appid - Sets the application identifier for your project.
    * --template - Specifies a valid npm package which you want to use to create your project. If --template is not set, the NativeScript CLI creates the project from the default JavaScript hello-world template.
    * --ng - Sets the template for your project to the Angular template.
    * --tsc - Sets the template for your project to the TypeScript template.

### Attributes

    * <App Name> is the name of project. The specified name must meet the requirements of all platforms that you want to target. For more information about the <App Name> requirements, run $ tns help create
    * <App ID> is the application identifier for your project. It must be a domain name in reverse and must meet the requirements of all platforms that you want to target. If not specified, the application identifier is set to org.nativescript.<App name> For more information about the <App ID> requirements, run $ tns help create
>nativescript-angular@6.1.0postinstall/Users/myUser/code/rsrpt/node_modules/nativescript
>节点postinstall.js
财政司司长:885
返回binding.mkdir(路径模块)_makeLong(路径),
^
错误:EACCES:权限被拒绝,mkdir'/Users/myUser/code/rsrpt/hooks'
在Object.fs.mkdirSync(fs.js:885:18)
在对象上。(/Users/myUser/code/rsrpt/node_modules/nativescript angular/postinstall.js:11:12)
编译(Module.js:652:30)
在Object.Module.\u extensions..js(Module.js:663:10)
在Module.load(Module.js:565:32)
在tryModuleLoad时(module.js:505:12)
在Function.Module.\u加载(Module.js:497:3)
位于Function.Module.runMain(Module.js:693:10)
启动时(bootstrap_node.js:191:16)
在bootstrap_node.js:612:3
npm错误!代码错误周期
npm错误!错误1
npm ERR!nativescript-angular@6.1.0postinstall:`node postinstall.js`
npm错误!退出状态1
npm错误!
npm ERR!在nativescript上失败-angular@6.1.0安装后脚本。
npm错误!这可能不是npm的问题。上面可能还有其他日志输出。
npm ERR!此运行的完整日志可在以下位置找到:
npm ERR!/Users/myUser/.npm/_logs/2018-08-14T00_22_47_432Z-debug.log
命令npm安装失败,退出代码为1
#tns创建
┌───────────────┬────────────────────────────────────────────────────────────┐
│ 用法│ 提要│
│ 创建自│ $ tns创建[--path][--appid]│
│ JavaScript│                                                            │
│ 模板│                                                            │
│ 创建自│ $ tns create--template typescript[--path│
│ 违约│ ] [--appid]或$tns create│
│ 打字稿│ --tsc[--path][--appid]或$│
│ 模板│ tns创建--模板tsc[--路径]│
│               │ [--appid]│
│ 创建自│ $ tns创建--模板角度[--路径│
│ 违约│ ] [--appid]或$tns create│
│ 有棱角的│ --模板ng[--path][--appid]│
│ 模板│ 或$tns create--ng[--path][-│
│               │ -appid]│
│ 抄袭│ $ tns创建[--path][--appid]│
│ 项目│                                                            │
│ 创建自│ $ tns创建[--path][--appid]--模板│
│ 模板│                                                            │
└───────────────┴────────────────────────────────────────────────────────────┘
使用NativeScript为本机开发创建新项目。
###选择权
*--路径-指定要在其中创建项目的目录(如果与当前目录不同)。该目录必须为空。
*--appid-设置项目的应用程序标识符。
*--template-指定要用于创建项目的有效npm包。如果未设置--template,则NativeScript CLI将从默认JavaScript hello world模板创建项目。
*--ng-将项目的模板设置为角度模板。
*--tsc-将项目的模板设置为TypeScript模板。
###属性
*是项目的名称。指定的名称必须满足要针对的所有平台的要求。有关要求的详细信息,请运行$tns help create
*是项目的应用程序标识符。它必须是一个反向域名,并且必须满足您要针对的所有平台的要求。如果未指定,则将应用程序标识符设置为org.nativescript。有关要求的详细信息,请运行$tns help create

您尝试过“tns医生”吗?我不确定它是否正在检查权限或权限规则。 您是否尝试了另一个目录?可能需要重新安装Complete(npm&nativescript)

> nativescript-angular@6.1.0 postinstall /Users/myUser/code/rsrpt/node_modules/nativescript-angular
> node postinstall.js

fs.js:885
  return binding.mkdir(pathModule._makeLong(path),
                 ^

Error: EACCES: permission denied, mkdir '/Users/myUser/code/rsrpt/hooks'
    at Object.fs.mkdirSync (fs.js:885:18)
    at Object.<anonymous> (/Users/myUser/code/rsrpt/node_modules/nativescript-angular/postinstall.js:11:12)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nativescript-angular@6.1.0 postinstall: `node postinstall.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the nativescript-angular@6.1.0 postinstall 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 run can be found in:
npm ERR!     /Users/myUser/.npm/_logs/2018-08-14T00_22_47_432Z-debug.log
Command npm install failed with exit code 1
# tns create

┌───────────────┬────────────────────────────────────────────────────────────┐
│ Usage         │ Synopsis                                                   │
│ Create from   │ $ tns create <App Name> [--path <Directory>] [--appid <App │
│ default       │ ID>]                                                       │
│ JavaScript    │                                                            │
│ template      │                                                            │
│ Create from   │ $ tns create <App Name> --template typescript [--path      │
│ default       │ <Directory>] [--appid <App ID>] OR $ tns create <App Name> │
│ TypeScript    │ --tsc [--path <Directory>] [--appid <App ID>] OR $         │
│ template      │ tns create <App Name> --template tsc [--path <Directory>]  │
│               │ [--appid <App ID>]                                         │
│ Create from   │ $ tns create <App Name> --template angular [--path         │
│ default       │ <Directory>] [--appid <App ID>] OR $ tns create <App Name> │
│ Angular       │ --template ng [--path <Directory>] [--appid <App ID>]      │
│ template      │ OR $ tns create <App Name> --ng [--path <Directory>] [-    │
│               │ -appid <App ID>]                                           │
│ Copy from     │ $ tns create <App Name> [--path <Directory>] [--appid <App │
│ existing      │ ID>]                                                       │
│ project       │                                                            │
│ Create from   │ $ tns create <App Name> [--path <Directory>] [--appid <App │
│ custom        │ ID>] --template <Template>                                 │
│ template      │                                                            │
└───────────────┴────────────────────────────────────────────────────────────┘

Creates a new project for native development with NativeScript.

### Options

    * --path - Specifies the directory where you want to create the project, if different from the current directory. The directory must be empty.
    * --appid - Sets the application identifier for your project.
    * --template - Specifies a valid npm package which you want to use to create your project. If --template is not set, the NativeScript CLI creates the project from the default JavaScript hello-world template.
    * --ng - Sets the template for your project to the Angular template.
    * --tsc - Sets the template for your project to the TypeScript template.

### Attributes

    * <App Name> is the name of project. The specified name must meet the requirements of all platforms that you want to target. For more information about the <App Name> requirements, run $ tns help create
    * <App ID> is the application identifier for your project. It must be a domain name in reverse and must meet the requirements of all platforms that you want to target. If not specified, the application identifier is set to org.nativescript.<App name> For more information about the <App ID> requirements, run $ tns help create