私は 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のアクセス許可を台無しにしていないことを願っています)
sudo chown -R $(whoami) ~/
しかし、何も役に立ちませんでした。添付の詳細なエラーがまだ表示されます。この許可の問題を克服する方法についての助けをいただければ幸いです! ありがとう!
> 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