对于一些npm包(我还没有弄清楚为什么),当它试图解决可传递的依赖关系时,构建会失败,例如googleapis。
下面是我的ember-cli-build.js:
app.import('node_modules/googleapis/build/src/index.js', {
using: [{ transformation: 'cjs', as: 'googleapis' }],
});
以下是错误输出:
Unexpected token
...
'fs' is imported by node_modules/google-auth-library/build/src/auth/googleauth.js, but could not be resolved – treating it as an external dependency
'fs' is imported by commonjs-external:fs, but could not be resolved – treating it as an external dependency
'url' is imported by commonjs-external:url, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules/lru-cache/index.js, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules/google-auth-library/build/src/auth/googleauth.js, but could not be resolved – treating it as an external dependency
'util' is imported by commonjs-external:util, but could not be resolved – treating it as an external dependency
'stream' is imported by node_modules/google-auth-library/build/src/auth/oauth2client.js, but could not be resolved – treating it as an external dependency
'stream' is imported by commonjs-external:stream, but could not be resolved – treating it as an external dependency
'stream' is imported by node_modules/jws/lib/sign-stream.js, but could not be resolved – treating it as an external dependency
'stream' is imported by node_modules/jws/lib/verify-stream.js, but could not be resolved – treating it as an external dependency
'stream' is imported by node_modules/jws/lib/data-stream.js, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules/jws/lib/sign-stream.js, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules/jws/lib/verify-stream.js, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules/jws/lib/data-stream.js, but could not be resolved – treating it as an external dependency
'fs' is imported by node_modules/gtoken/build/src/index.js, but could not be resolved – treating it as an external dependency
...
and some more...
1条答案
按热度按时间vs91vp4v1#
根据自述文件:https://www.npmjs.com/package/googleapis
这是不是意味着使用在浏览器.
你有可以使用googlapis的服务器吗?