{"record":{"id":"a3c3d235dcc6837b","repo":"nodejs/node","slug":"prop-is-not-a-property-we-can-set-valid-prop","errorCode":null,"errorMessage":"\"${prop}\" is not a property we can set. Valid properties are: ${writableProfileKeys.join(', ')}","messagePattern":"\"(.+?)\" is not a property we can set\\. Valid properties are: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"deps/npm/lib/commands/profile.js","lineNumber":190,"sourceCode":"        log.warn('profile', 'Passwords do not match, please try again.')\n        return readPasswords()\n      }\n\n      return newpassword\n    }\n\n    if (prop !== 'password' && value === null) {\n      throw new Error('npm profile set <prop> <value>')\n    }\n\n    if (prop === 'password' && value !== null) {\n      throw new Error(\n        'npm profile set password\\n' +\n        'Do not include your current or new passwords on the command line.')\n    }\n\n    if (writableProfileKeys.indexOf(prop) === -1) {\n      throw new Error(`\"${prop}\" is not a property we can set. ` +\n        `Valid properties are: ` + writableProfileKeys.join(', '))\n    }\n\n    if (prop === 'password') {\n      const current = await readUserInfo.password('Current password: ')\n      const newpassword = await readPasswords()\n\n      value = { old: current, new: newpassword }\n    }\n\n    // FIXME: Work around to not clear everything other than what we're setting\n    const user = await get(conf)\n    const newUser = {}\n\n    for (const key of writableProfileKeys) {\n      newUser[key] = user[key]\n    }\n","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/npm/lib/commands/profile.js#L172-L208","documentation":"Thrown by the `profile set` method when the property name is not in the list of writable profile keys (writableProfileKeys). The npm profile API only allows setting certain properties — typically: name, email, password, fullname, homepage, freemail, twitter, github, and cidr_whitelist. Any other property name triggers this error.","triggerScenarios":"Running `npm profile set <invalid-prop> <value>` where invalid-prop is not in writableProfileKeys. The code checks `if (writableProfileKeys.indexOf(prop) === -1)`.","commonSituations":"Trying to set a property that doesn't exist on the npm profile model (e.g., `npm profile set username`, `npm profile set plan`). Misspelling a valid property (e.g., 'twiter' instead of 'twitter').","solutions":["Use a valid writable property — the error message lists them via writableProfileKeys.join(', ')","Check spelling against the list in the error message","Run `npm profile get` to see current profile fields and identify which are settable"],"exampleFix":"// before\nnpm profile set twiter @myhandle\n\n// after\nnpm profile set twitter myhandle","handlingStrategy":"validation","validationCode":"const WRITABLE_PROFILE_KEYS = ['name', 'email', 'password', 'fullname', 'homepage', 'freemail', 'twitter', 'github', 'cidr_whitelist']\nfunction isWritableProfileKey(prop) {\n  return WRITABLE_PROFILE_KEYS.includes(prop)\n}\n// Before setting:\nif (!isWritableProfileKey(prop)) {\n  throw new Error(prop + ' is not writable. Valid: ' + WRITABLE_PROFILE_KEYS.join(', '))\n}","typeGuard":"function isWritableProfileProp(prop) {\n  return typeof prop === 'string'\n    && ['name', 'email', 'password', 'fullname', 'homepage',\n        'freemail', 'twitter', 'github', 'cidr_whitelist'].includes(prop)\n}","tryCatchPattern":"try {\n  await exec(['set', prop, value])\n} catch (e) {\n  if (e.message.includes('not a property we can set')) {\n    console.error('Check writable properties in the error message')\n  }\n  throw e\n}","preventionTips":["Run npm profile get to see available profile fields","The error message lists all valid writable properties — read it","Common valid properties: email, fullname, twitter, github, homepage, cidr_whitelist"],"tags":["npm","profile","argument-validation","cli"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}