这是我启动nodemon后的输出。在使用apostrophe-cli创建项目之后,我还具有最新的nodemon配置。我在网上尝试了许多解决方案,但都没有解决它。 Nodemon配置或Windows系统本身中的某种错误。我也确实在管理员控制台中运行了nodemon。
[nodemon] 1.18.3
[nodemon] reading config .\package.json[nodemon] to restart at any time, enter `rs`
[nodemon] or send SIGHUP to 10964 to restart[nodemon] ignoring: locales/*.json public/modules/**/*.less public/modules/**/*.js .\public\uploads/**/* public/apos-minified/*.js public/css/master-*.less .\data/**/*
[nodemon] watching: *.*
[nodemon] watching extensions: json,js,html,less
[nodemon] starting `node app.js`
[nodemon] forking
[nodemon] child pid: 13600
[nodemon] watching 1164 files
apostrophe-profiler: APOS_PROFILER environment variable not set, doing nothing.
C:\Users\Alienware\Desktop\amin-website\node_modules\rimraf\rimraf.js:313
throw er
^
Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\Alienware\Desktop\amin-website\public\modules\apostrophe-assets\js'
at Object.fs.rmdirSync (fs.js:870:18)
at rmkidsSync (C:\Users\Alienware\Desktop\amin-website\node_modules\rimraf\rimraf.js:356:25)
at rmdirSync (C:\Users\Alienware\Desktop\amin-website\node_modules\rimraf\rimraf.js:334:7)
at rimrafSync (C:\Users\Alienware\Desktop\amin-website\node_modules\rimraf\rimraf.js:304:9)
at C:\Users\Alienware\Desktop\amin-website\node_modules\rimraf\rimraf.js:342:5
at Array.forEach (<anonymous>)
at rmkidsSync (C:\Users\Alienware\Desktop\amin-website\node_modules\rimraf\rimraf.js:341:26)
at rmdirSync (C:\Users\Alienware\Desktop\amin-website\node_modules\rimraf\rimraf.js:334:7)
at Function.rimrafSync [as sync] (C:\Users\Alienware\Desktop\amin-website\node_modules\rimraf\rimraf.js:304:9)
at Object.self.removeThenRecursiveCopy (C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\lib\modules\apostrophe-assets\index.js:690:18)
at Object.self.linkAssetFolderOnWindows (C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\lib\modules\apostrophe-assets\index.js:673:19)
at Object.self.linkAssetFolder (C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\lib\modules\apostrophe-assets\index.js:628:14)
at C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\lib\modules\apostrophe-assets\index.js:596:14
at C:\Users\Alienware\Desktop\amin-website\node_modules\@sailshq\lodash\lib\index.js:3253:15
at baseForOwn (C:\Users\Alienware\Desktop\amin-website\node_modules\@sailshq\lodash\lib\index.js:2223:14)
at C:\Users\Alienware\Desktop\amin-website\node_modules\@sailshq\lodash\lib\index.js:3223:18
再次运行nodemon时,它以不同的错误出现:
[nodemon] 1.18.3
[nodemon] reading config .\package.json[nodemon] to restart at any time, enter `rs`
[nodemon] or send SIGHUP to 21852 to restart[nodemon] ignoring: locales/*.json public/modules/**/*.less public/modules/**/*.js .\public\uploads/**/* public/apos-minified/*.js public/css/master-*.less .\data/**/*
[nodemon] watching: *.*
[nodemon] watching extensions: json,js,html,less
[nodemon] starting `node app.js`
[nodemon] forking
[nodemon] child pid: 26028
[nodemon] watching 1330 files
apostrophe-profiler: APOS_PROFILER environment variable not set, doing nothing.
fs.js:909
return binding.mkdir(pathModule.toNamespacedPath(path),
^
Error: EPERM: operation not permitted, mkdir 'C:\Users\Alienware\Desktop\amin-website\public\modules\apostrophe-admin-bar'
at Object.fs.mkdirSync (fs.js:909:18)
at copyDir (C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\lib\modules\apostrophe-assets\index.js:709:14)
at Object.self.recursiveCopy (C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\lib\modules\apostrophe-assets\index.js:705:7)
at Object.self.removeThenRecursiveCopy (C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\lib\modules\apostrophe-assets\index.js:693:12) at Object.self.linkAssetFolderOnWindows (C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\lib\modules\apostrophe-assets\index.js:673:19)
at Object.self.linkAssetFolder (C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\lib\modules\apostrophe-assets\index.js:628:14)
at C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\lib\modules\apostrophe-assets\index.js:596:14
at C:\Users\Alienware\Desktop\amin-website\node_modules\@sailshq\lodash\lib\index.js:3253:15
at baseForOwn (C:\Users\Alienware\Desktop\amin-website\node_modules\@sailshq\lodash\lib\index.js:2223:14)
at C:\Users\Alienware\Desktop\amin-website\node_modules\@sailshq\lodash\lib\index.js:3223:18
at Function.<anonymous> (C:\Users\Alienware\Desktop\amin-website\node_modules\@sailshq\lodash\lib\index.js:3526:13)
at self.symlinkModules (C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\lib\modules\apostrophe-assets\index.js:592:9)
at C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\node_modules\async\lib\async.js:718:13
at iterate (C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\node_modules\async\lib\async.js:262:13)
at async.forEachOfSeries.async.eachOfSeries (C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\node_modules\async\lib\async.js:281:9)
at _parallel (C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\node_modules\async\lib\async.js:717:9)
[nodemon] app crashed - waiting for file changes before starting...
再次运行nodemon,出现此错误:
Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\Alienware\Desktop\amin-website\public\modules\apostrophe-notifications\css'
at Object.fs.rmdirSync (fs.js:870:18)
at rmkidsSync (C:\Users\Alienware\Desktop\amin-website\node_modules\rimraf\rimraf.js:356:25)
at rmdirSync (C:\Users\Alienware\Desktop\amin-website\node_modules\rimraf\rimraf.js:334:7)
at rimrafSync (C:\Users\Alienware\Desktop\amin-website\node_modules\rimraf\rimraf.js:304:9)
at C:\Users\Alienware\Desktop\amin-website\node_modules\rimraf\rimraf.js:342:5
at Array.forEach (<anonymous>)
at rmkidsSync (C:\Users\Alienware\Desktop\amin-website\node_modules\rimraf\rimraf.js:341:26)
at rmdirSync (C:\Users\Alienware\Desktop\amin-website\node_modules\rimraf\rimraf.js:334:7)
at Function.rimrafSync [as sync] (C:\Users\Alienware\Desktop\amin-website\node_modules\rimraf\rimraf.js:304:9)
at Object.self.removeThenRecursiveCopy (C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\lib\modules\apostrophe-assets\index.js:690:18)
at Object.self.linkAssetFolderOnWindows (C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\lib\modules\apostrophe-assets\index.js:673:19)
at Object.self.linkAssetFolder (C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\lib\modules\apostrophe-assets\index.js:628:14)
at C:\Users\Alienware\Desktop\amin-website\node_modules\apostrophe\lib\modules\apostrophe-assets\index.js:596:14
at C:\Users\Alienware\Desktop\amin-website\node_modules\@sailshq\lodash\lib\index.js:3253:15
at baseForOwn (C:\Users\Alienware\Desktop\amin-website\node_modules\@sailshq\lodash\lib\index.js:2223:14)
at C:\Users\Alienware\Desktop\amin-website\node_modules\@sailshq\lodash\lib\index.js:3223:18
再次运行其他时间,在我的visual studio代码输出中是这样的:
[Error - 1:27:44 AM] (node:17664) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: EPERM: operation not permitted, open 'c:\Users\Alienware\Desktop\amin-website\public\modules\apostrophe-assets\css\vendor\cropper.less'
[Error - 1:27:52 AM] (node:17664) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[Error - 1:27:56 AM] (node:17664) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: EPERM: operation not permitted, open 'c:\Users\Alienware\Desktop\amin-website\public\modules\apostrophe-assets\css\vendor\jquery-ui-3.less'
[Error - 1:27:59 AM] (node:17664) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: EPERM: operation not permitted, open 'c:\Users\Alienware\Desktop\amin-website\public\modules\apostrophe-assets\css\vendor\jquery-ui.less'
[Error - 1:28:01 AM] (node:17664) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): Error: EPERM: operation not permitted, open 'c:\Users\Alienware\Desktop\amin-website\public\modules\apostrophe-assets\css\vendor\pikaday.less'
[Error - 1:28:03 AM] (node:17664) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 5): Error: EPERM: operation not permitted, open 'c:\Users\Alienware\Desktop\amin-website\public\modules\apostrophe-assets\css\vendor\spectrum.less'
[Error - 1:28:22 AM] (node:17664) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
[Error - 1:28:23 AM] (node:17664) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 2)
[Error - 1:28:23 AM] (node:17664) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 3)
[Error - 1:28:24 AM] (node:17664) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 4)
[Error - 1:28:26 AM] (node:17664) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 5)
答案 0 :(得分:2)
我遇到了这类问题,直到我在撇号论坛上找到了以下帖子
http://forum.apostrophecms.org/t/nodemon-instead-of-node/458
解决方案是更改您的package.json并修改nodemon部分,并确保其具有“ watch”参数,如下所示:
“ nodemonConfig”:{ “ verbose”:是的, “ watch”:[“ app.js”,“ lib / modules”] }
我希望这对您有帮助