我尝试下载解析服务器源代码(2.2.21 on 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 |
如何解决这个问题? 感谢。
答案 0 :(得分:0)
如果编辑文件WinstonLogger.js(./src/Adapters/Logger/WinstonLogger.js)
并删除函数addTransport,configureLogger和removeTransport之前的“export”字样。