#build #npm #parse-server #babeljs
#сборка #npm #синтаксический анализ-сервер #babeljs
Вопрос:
Я попытался загрузить исходный код parse-server (2.2.21 на github) и выполнить сборку, но я получаю эту ошибку.
выполнить команду $ npm install
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
> bcrypt@0.8.7 install /Users/dora/parse-server/node_modules/bcrypt
> node-gyp rebuild
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
SOLINK_MODULE(target) Release/bcrypt_lib.node
clang: warning: libstdc is deprecated; move to libc with a minimum deployment target of OS X 10.9
npm WARN deprecated graceful-fs@2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
…
> parse-server@2.2.20 prepublish /Users/dora/parse-server
> npm run build
> parse-server@2.2.20 build /Users/dora/parse-server
произошла ошибка
> babel src/ -d lib/
src/AccountLockout.js -> lib/AccountLockout.js
src/Adapters/AdapterLoader.js -> lib/Adapters/AdapterLoader.js
src/Adapters/Analytics/AnalyticsAdapter.js -> lib/Adapters/Analytics/AnalyticsAdapter.js
src/Adapters/Cache/CacheAdapter.js -> lib/Adapters/Cache/CacheAdapter.js
...
src/Adapters/Logger/LoggerAdapter.js -> lib/Adapters/Logger/LoggerAdapter.js
SyntaxError: src/Adapters/Logger/WinstonLogger.js: `addTransport` has already been exported. Exported identifiers must be unique. (98:17)
96 | }
97 |
> 98 | export { logger, addTransport, configureLogger, removeTransport };
| ^
99 | export default logger;
100 |
Как это исправить?
Спасибо.
Ответ №1:
Если вы отредактируете файл WinstonLogger.js (./src/Adapters/Logger/WinstonLogger.js )
и удалите слова «экспорт» перед функциями addTransport, configureLogger и removeTransport, это должно сработать.