Getting an: Unexpected error, when attempting gulp...
# suitecommerce
b
Getting an: Unexpected error, when attempting gulp theme:fetch. SCA 2022.1, Node 12.21.0, Gulp 4.0.2
s
You will need to modify a file in the developer tools: ns_npm_repository\oauth1\index.js.
Copy code
// Look for this
const hostnameStep1 = this.vm ? hostName : `rest${molecule}.<http://netsuite.com|netsuite.com>`;

// Change it to this
const hostnameStep1 = this.vm ? hostName : `system${molecule}.<http://netsuite.com|netsuite.com>`;
In some older versions of the tools, it will look like this:
Copy code
// Look for this
var hostnameStep1 = this.vm ? hostName : "rest" + molecule + ".<http://netsuite.com|netsuite.com>";
 
// Change it to this
var hostnameStep1 = this.vm ? hostName : "system" + molecule + ".<http://netsuite.com|netsuite.com>";
b
Copy code
const molecule = this.molecule ? `.${this.molecule}` : '';
        const hostName = this.vm && this.vm.replace(/https?:\/\//, '');

        let hostnameStep1;
        if (this.vm) {
            hostnameStep1 = hostName;
        } else if (account) {
            hostnameStep1 = `${account}.restlets.api${molecule}.<http://netsuite.com|netsuite.com>`;
        } else {
            hostnameStep1 = `system${molecule}.<http://netsuite.com|netsuite.com>`;
        }

        const hostnameStep2 = this.vm || `<https://system>${molecule}.<http://netsuite.com|netsuite.com>`;
        const hostnameStep3 = this.vm ? hostName : `.restlets.api${molecule}.<http://netsuite.com|netsuite.com>`;
This seems to be the relevant section. I tried replacing the if else block with just this line, but same result:
Copy code
const hostnameStep1 = this.vm ? hostName : `system${molecule}.<http://netsuite.com|netsuite.com>`;
Update: I resolved this by creating a new token through the CLI instead of using one of the saved tokens. I had previously manually created a token and saved it to the .env file, but I guess that method does not work.