Nodemon в ApostropheCMS не работает

Это мой вывод после запуска nodemon. У меня также есть последняя конфигурация nodemon после create-проекта с использованием apostrophe-cli . Я пробовал много решений онлайн, но ни одно из них не исправило это. Как-то ошибки в конфиге 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

А также в другой раз, на моей визуальной студии вывод получился так:

    [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)

1 ответ

Решение

У меня были такие проблемы, пока я не нашел следующий пост на форуме апостроф

http://forum.apostrophecms.org/t/nodemon-instead-of-node/458

Решение состоит в том, чтобы изменить ваш package.json и изменить раздел nodemon и убедиться, что он имеет параметр "watch" следующим образом

"nodemonConfig": { "verbose": true, "watch": ["app.js", "lib/modules"] }

надеюсь, это поможет

Другие вопросы по тегам