Error: Package exports for '.\colorette' do not define a valid '.' target
abhichatbot opened this issue ยท 20 comments
Installed with material-ui but not able to compile due to this.
@abhichatbot Could you create a repo so I can reproduce this? Also, make sure this is not a dupe of #48.
Closing due to lack of activity. And this is most likely a duple of #48. ๐
I just got this error in Travis.
Here's my package.json
"dependencies": {
"core-js": "^3.6.5",
"firebase": "^7.18.0",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"vue-template-compiler": "^2.6.11"
},
Here's main part of my Travis yml.
...
language: node_js
node_js:
- "13.0"
install:
- npm install
- npm run build
...
Some error logs in Travis
$ node --version
v13.0.1
$ npm --version
6.12.0
$ nvm --version
0.35.3
before_install
22.92s$ npm install -g firebase-tools
install.1
30.76s$ npm install
0.98s$ npm run build
> ___@0.1.0 build /home/travis/build/___/___
> vue-cli-service build
- Building for production...
ERROR Error: Package exports for '/home/travis/build/___/___/node_modules/colorette' do not define a valid '.' target
Changed to Node v12 and it's all good now. ๐
node_js:
- "12"
Actually, maybe the error occurs with 13.0.1 only.
Yes, that's correct. You may also upgrade to >=14.
This is happening for me on node version 12.4.1
@isochronous Are you sure? That doesn't seem to be a valid Node version. https://nodejs.org/dist/v12.4.1
My bad, missed a 1, it's 12.14.1
For the time being I've just reverted to an earlier version of the package requiring colorette, which in turn requires a version of colorette that doesn't exhibit the same issue.
Just tested it with 12.14.1 and it's working. This must be an issue with that package or your configuration. What package is that?
As far as I can tell, it's autoprefixer. It's hard to tell for sure because the only place the error occurs is on a remote build agent that doesn't provide very detailed logs.
@isochronous Make sure you're not in fact using Node 13. It does happen: postcss/autoprefixer#1352, postcss/autoprefixer#1353 (comment)
I mean, I'm definitely not according to nvm
@isochronous Did you try?
I speculate the issue is in your project or your environment, and not autoprefixer. I've run out of ideasโsorry! ๐
Yeah, I'm pretty sure there's something screwed up in the environment as well - last couple of builds it's told me it can't find autoprefixer on npm -_-
Thanks for trying though :)
So, just to update, we had the same exact issue happen on node 12.14.1 (verified by using console.log(process.version)
on three different build agents. However, I updated to the latest LTS (12.18.3, I believe) and the problem went away. I have no idea what the issue was, but it was remarkably consistent across those three machines.
@isochronous By creating an empty project using 12.14.1, importing colorette and trying something like red("hello")
, you can rule out colorette is the issue, assuming that works. Worked for me.
The problem occurs on install, so I don't think that would work. I'm seriously confused as to WTF is going on here. Like I said though, it works on a different version of node, so it's NBD, just thought you might be interested to hear the resolution.
Definitely. Thank you for sharing it!
Had the same issue today with version 13.0.1. After updating node to 14.9 this was resolved