Tôi đang theo dõi tài liệu Sails và cố chạy thử nghiệm Mocha. Tôi đã chỉnh sửa package.json
theo cách tài liệu được chỉ định, nhưng vì một lý do nào đó khi tôi cố gắng chạy Mocha, tôi luôn nhận được EACESS, sự cho phép bị từ chối lỗi.không chạy thử nghiệm mocha với buồm
Lúc đầu, tôi nhận được:
Error: EACCES, permission denied '/Library/Application Support/Apple/ParentalControls/Users'
Tôi không hiểu tại sao nó sẽ phải làm gì với chạy thử nghiệm của tôi, nhưng gia tăng sự cho phép cần thiết cho thư mục này.
sau đó tôi nhận:
Error: EACCES, permission denied '/Library/Application Support/ApplePushService'
Một lần nữa, không hiểu, vì vậy thay đổi sự cho phép trên thư mục này, mà không giúp cũng có.
Tôi không hiểu tại sao Mocha cần quyền trên các tệp này hoặc cách khắc phục.
Tôi chạy lệnh:
mocha test/bootstrap.test.js test/unit/**/*.test.js
Và cấu trúc dự án của tôi là chính xác giống như trong Sails hướng dẫn.
Tôi đang sử dụng [email protected]. Đồng nghiệp của tôi nhân bản repo, và cố gắng chạy các thử nghiệm trên máy của mình, nhưng không thành công với chính xác cùng một lỗi.
Tôi đã cố gắng hạ cấp xuống [email protected] Điều nào cũng không giúp ích gì.
Các lỗi dấu vết đầy đủ:
events.js:85
throw er; // Unhandled 'error' event
^
Error: EACCES, permission denied '/Library/Application Support/ApplePushService'
at Error (native)
at Object.fs.readdirSync (fs.js:761:18)
at Glob._readdir (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:609:20)
at Glob._process (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:393:15)
at Glob.<anonymous> (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:427:14)
at Array.forEach (native)
at Glob.<anonymous> (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:426:9)
at Glob._afterReaddir (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:635:15)
at Glob._readdir (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:613:17)
at Glob._process (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:393:15)
at Glob.<anonymous> (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:427:14)
at Array.forEach (native)
at Glob.<anonymous> (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:426:9)
at Glob._afterReaddir (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:635:15)
at Glob._readdir (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:613:17)
at Glob._process (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:393:15)
at Glob.<anonymous> (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:427:14)
at Array.forEach (native)
at Glob.<anonymous> (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:426:9)
at Glob._afterReaddir (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:635:15)
at Glob._readdir (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:613:17)
at Glob._process (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:393:15)
at Glob.iterator (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:171:10)
at Array.forEach (native)
at new Glob (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:169:22)
at glob (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:57:11)
at Function.globSync (/usr/local/lib/node_modules/mocha/node_modules/glob/glob.js:76:10)
at Object.lookupFiles (/usr/local/lib/node_modules/mocha/lib/utils.js:590:20)
at /usr/local/lib/node_modules/mocha/bin/_mocha:320:30
at Array.forEach (native)
at Object.<anonymous> (/usr/local/lib/node_modules/mocha/bin/_mocha:319:6)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
npm ERR! Test failed. See above for more details.
gì 'ls test/unit/**/* .test.js' làm gì? Có vẻ như có thể có một liên kết tượng trưng đến '/ Library/Application Support /' ở đâu đó trong thư mục 'test /' của bạn. – robertklep
Chạy lệnh 'ls' trả về:' test/unit/controllers/UserController.test.js test/unit/models/User.test.js' là hai tệp thử nghiệm của tôi. Tôi không thấy bất kỳ liên kết tượng trưng nào khi tìm kiếm. – OmriToptix
có thể đó là vấn đề với thư mục cụ thể của bạn? thử chạy 'npm cache clean' và sau đó' npm install' một lần nữa và chạy lại lệnh và xem nó có hoạt động không. Nếu không, có thể thử chuyển đổi dirs? –