`npx oz link @openzeppelin/upgrades` error: Cannot read property 'trim' of undefined

But in

$ npx oz link @openzeppelin/upgrades
✓ Dependency @openzeppelin/upgrades installed
Cannot read property 'trim' of undefined

I have no idea what "Cannot read property 'trim' of undefined" meant

1 Like

Hi @vikram,

We only need to use oz link for Ethereum Packages such as OpenZeppelin Contracts Ethereum Package (see: https://docs.openzeppelin.com/cli/2.6/dependencies#linking-the-contracts-ethereum-package)

For @openzeppelin/upgrades as it isn’t an Ethereum Package we can just use npm install @openzeppelin/upgrades to install the package.

The error message Cannot read property 'trim' of undefined is confusing, I assume this is an error when attempting to do the linking after installing the package. When I was investigating the package is installed, it is the linking which fails.

I created Issue https://github.com/OpenZeppelin/openzeppelin-sdk/issues/1458 to improve the error message.

1 Like